976 |
|
} |
977 |
|
} |
978 |
|
|
979 |
– |
<T> T chooseRandomly(T... choices) { |
980 |
– |
return choices[ThreadLocalRandom.current().nextInt(choices.length)]; |
981 |
– |
} |
982 |
– |
|
979 |
|
/** |
980 |
|
* Non-traversing Deque operations (that return null) are linearizable. |
981 |
|
* Don't return null when the deque is observably never empty. |
983 |
|
* ant -Djsr166.expensiveTests=true -Djsr166.tckTestClass=ConcurrentLinkedDequeTest -Djsr166.methodFilter=testBug8189387 tck |
984 |
|
*/ |
985 |
|
public void testBug8189387() { |
990 |
– |
final ThreadLocalRandom rnd = ThreadLocalRandom.current(); |
986 |
|
Object x = new Object(); |
987 |
|
for (int n = expensiveTests ? 100_000 : 10; n--> 0; ) { |
988 |
|
ConcurrentLinkedDeque<Object> d = new ConcurrentLinkedDeque<>(); |