Package com.oracle.coherence.common.base
Class NonBlocking
java.lang.Object
com.oracle.coherence.common.base.NonBlocking
- All Implemented Interfaces:
AutoCloseable
NonBlocking allows a thread to mark itself as non-blocking and should be exempt from things such as
flow-control pauses using a try-with-resource pattern.
try (NonBlocking e = new NonBlocking()) { // NonBlocking.isNonBlockingCaller() will now be true, and FlowControlled elements should respect this and not block } // NonBlocking.isNonBlockingCaller() will have been restored to its former value
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static boolean
Return true if the the calling thread has been marked as non-blocking
-
Constructor Details
-
NonBlocking
public NonBlocking()
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-
isNonBlockingCaller
public static boolean isNonBlockingCaller()Return true if the the calling thread has been marked as non-blocking- Returns:
- true iff the calling thread is marked as non-blocking
-