|
|
@ -124,7 +124,6 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
|
|
|
|
final long startScan = System.nanoTime();
|
|
|
|
final long startScan = System.nanoTime();
|
|
|
|
final long originTimeout = timeout;
|
|
|
|
final long originTimeout = timeout;
|
|
|
|
long startSeq;
|
|
|
|
long startSeq;
|
|
|
|
try {
|
|
|
|
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
startSeq = synchronizer.currentSequence();
|
|
|
|
startSeq = synchronizer.currentSequence();
|
|
|
@ -141,10 +140,6 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
|
|
|
|
|
|
|
|
|
|
|
|
timeout = originTimeout - (System.nanoTime() - startScan);
|
|
|
|
timeout = originTimeout - (System.nanoTime() - startScan);
|
|
|
|
} while (timeout > 1000L && synchronizer.waitUntilSequenceExceeded(startSeq, timeout));
|
|
|
|
} while (timeout > 1000L && synchronizer.waitUntilSequenceExceeded(startSeq, timeout));
|
|
|
|
}
|
|
|
|
|
|
|
|
finally {
|
|
|
|
|
|
|
|
synchronizer.signal();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|