134 |
|
* |
135 |
|
* * Completion method tryFire(int mode) invokes the associated x |
136 |
|
* method with its held arguments, and on success cleans up. |
137 |
< |
* The mode argument allows exec to be called twice (SYNC, then |
138 |
< |
* ASYNC); the first to screen and trap exceptions while |
137 |
> |
* The mode argument allows tryFire to be called twice (SYNC, |
138 |
> |
* then ASYNC); the first to screen and trap exceptions while |
139 |
|
* arranging to execute, and the second when called from a |
140 |
|
* task. (A few classes are not used async so take slightly |
141 |
|
* different forms.) The claim() callback suppresses function |
162 |
|
* is guaranteed not to be observable (i.e., not yet returned or |
163 |
|
* linked). Multiple threads can call postComplete, which |
164 |
|
* atomically pops each dependent action, and tries to trigger it |
165 |
< |
* via method exec. Triggering can propagate recursively, so exec |
166 |
< |
* in NESTED mode returns its completed dependent (if one exists) |
167 |
< |
* for further processing by its caller (see method postFire). |
165 |
> |
* via method tryFire, in NESTED mode. Triggering can propagate |
166 |
> |
* recursively, so NESTED mode returns its completed dependent (if |
167 |
> |
* one exists) for further processing by its caller (see method |
168 |
> |
* postFire). |
169 |
|
* |
170 |
|
* Blocking methods get() and join() rely on Signaller Completions |
171 |
|
* that wake up waiting threads. The mechanics are similar to |
387 |
|
return e; |
388 |
|
} |
389 |
|
|
390 |
< |
// Modes for Completion.exec. Signedness matters. |
390 |
> |
// Modes for Completion.tryFire. Signedness matters. |
391 |
|
static final int SYNC = 0; |
392 |
|
static final int ASYNC = 1; |
393 |
|
static final int NESTED = -1; |