1 |
|
/* |
2 |
– |
* @test |
3 |
– |
* @summary tests lockInterruptibly |
4 |
– |
* Checks for responsiveness of locks to interrupts. Runs under that |
5 |
– |
* assumption that ITERS_VALUE computations require more than TIMEOUT |
6 |
– |
* msecs to complete. |
7 |
– |
*/ |
8 |
– |
/* |
2 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
3 |
< |
* Expert Group and released to the public domain. Use, modify, and |
4 |
< |
* redistribute this code in any way without acknowledgement. |
3 |
> |
* Expert Group and released to the public domain, as explained at |
4 |
> |
* http://creativecommons.org/licenses/publicdomain |
5 |
|
*/ |
6 |
|
|
7 |
|
import java.util.concurrent.*; |
76 |
|
finally { |
77 |
|
lock.unlock(); |
78 |
|
} |
79 |
< |
if (completed != 2) |
79 |
> |
if (c != 2) |
80 |
|
throw new Error("Completed != 2"); |
81 |
|
int r = result; |
82 |
|
if (r == 0) // avoid overoptimization |