293 |
|
} |
294 |
|
|
295 |
|
/** |
296 |
< |
* Ensures that any interrupt from a possible cancel(true) does |
297 |
< |
* not leak into subsequent code. |
296 |
> |
* Ensures that any interrupt from a possible cancel(true) is only |
297 |
> |
* delivered to a task while in run or runAndReset. |
298 |
|
*/ |
299 |
|
private void handlePossibleCancellationInterrupt(int s) { |
300 |
|
// It is possible for our interrupter to stall before getting a |
305 |
|
} |
306 |
|
// assert state == INTERRUPTED; |
307 |
|
|
308 |
< |
// Clear any interrupt we may have received from cancel(true). |
309 |
< |
Thread.interrupted(); |
308 |
> |
// We want to clear any interrupt we may have received from |
309 |
> |
// cancel(true). However, it is permissible to use interrupts |
310 |
> |
// as an independent mechanism for a task to communicate with |
311 |
> |
// its caller, and there is no way to clear only the |
312 |
> |
// cancellation interrupt. |
313 |
> |
// |
314 |
> |
// Thread.interrupted(); |
315 |
|
} |
316 |
|
|
317 |
|
/** |