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 TypeMethodDescriptionbooleanblock()voidShould be called by worker threads when a fatal exception occurs, so that all threads fail-fast and no deadlock occurs.voidCancels 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:
breakBarrierin interfaceIKernelBarrier
-
cancelBarrier
public void cancelBarrier()Description copied from interface:IKernelBarrierCancels the barrier. All threads that may be waiting for the barrier are released and barrier is permanently disabled.- Specified by:
cancelBarrierin interfaceIKernelBarrier
-
block
- Specified by:
blockin interfaceForkJoinPool.ManagedBlocker- Throws:
InterruptedException
-
isReleasable
public boolean isReleasable()- Specified by:
isReleasablein interfaceForkJoinPool.ManagedBlocker
-