Package com.aparapi.internal.kernel
Class KernelRunner.FJSafeBarrier
java.lang.Object
com.aparapi.internal.kernel.KernelRunner.FJSafeBarrier
- All Implemented Interfaces:
IKernelBarrier
,ForkJoinPool.ManagedBlocker
- Enclosing class:
KernelRunner
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final AtomicBoolean
(package private) final AtomicBoolean
(package private) final Object
(package private) int
(package private) final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
block()
void
Should be called by worker threads when a fatal exception occurs, so that all threads fail-fast and no deadlock occurs.void
Cancels the barrier.boolean
-
Field Details
-
threads
final int threads -
brokenBarrier
-
canceled
-
lock
-
remainingThreads
int remainingThreads
-
-
Constructor Details
-
FJSafeBarrier
FJSafeBarrier(int threads)
-
-
Method Details
-
breakBarrier
Should be called by worker threads when a fatal exception occurs, so that all threads fail-fast and no deadlock occurs.- Specified by:
breakBarrier
in interfaceIKernelBarrier
-
cancelBarrier
public void cancelBarrier()Description copied from interface:IKernelBarrier
Cancels the barrier. All threads that may be waiting for the barrier are released and barrier is permanently disabled.- Specified by:
cancelBarrier
in interfaceIKernelBarrier
-
block
- Specified by:
block
in interfaceForkJoinPool.ManagedBlocker
- Throws:
InterruptedException
-
isReleasable
public boolean isReleasable()- Specified by:
isReleasable
in interfaceForkJoinPool.ManagedBlocker
-