| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Throwable | |
| private final Object | |
| private final long | |
| private static final Unsafe |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected long | addressToPollForCancel()
Returns the memory address of a 4-byte int that should be polled to detect cancellation. |
| pack-priv final void | |
| protected int | cancelValue()
The value to write to the polled memory location to indicate that the task has been cancelled. |
| private Throwable | |
| pack-priv abstract void | |
| public final void | |
| pack-priv static void |
| completed | back to summary |
|---|---|
| private boolean completed | |
| exception | back to summary |
|---|---|
| private Throwable exception | |
| lock | back to summary |
|---|---|
| private final Object lock | |
| pollingAddress | back to summary |
|---|---|
| private final long pollingAddress | |
| unsafe | back to summary |
|---|---|
| private static final Unsafe unsafe | |
| Cancellable | back to summary |
|---|---|
| protected Cancellable() | |
| addressToPollForCancel | back to summary |
|---|---|
| protected long addressToPollForCancel() Returns the memory address of a 4-byte int that should be polled to detect cancellation. | |
| cancel | back to summary |
|---|---|
| pack-priv final void cancel() "cancels" the task by writing bits into memory location that it polled by the task. | |
| cancelValue | back to summary |
|---|---|
| protected int cancelValue() The value to write to the polled memory location to indicate that the task has been cancelled. If this method is not overridden then it defaults to MAX_VALUE. | |
| exception | back to summary |
|---|---|
| private Throwable exception() Returns the exception thrown by the task or null if the task completed successfully. | |
| implRun | back to summary |
|---|---|
| pack-priv abstract void implRun() throws Throwable The task body. This should periodically poll the memory location to check for cancellation. | |
| run | back to summary |
|---|---|
| public final void run() Implements java. Doc from java. Runs this operation.
| |
| runInterruptibly | back to summary |
|---|---|
| pack-priv static void runInterruptibly(Cancellable task) throws ExecutionException Invokes the given task in its own thread. If this (meaning the current) thread is interrupted then an attempt is make to cancel the background thread by writing into the memory location that it polls cooperatively. | |