[concurrency-interest] deadline and long overflow
alarmnummer at gmail.com
Wed Apr 20 06:05:09 EDT 2016
I have a question regarding dealing with deadlines and long overflow.
For example the following from the SynchronousQueue:
final long deadline = timed ? System.nanoTime() + nanos : 0L;
What would happen if someone calls queue.offer(item, Long.MAX_VALUE, NANOS)
then deadline overflows and becomes negative. I see the same approach in
other parts e.g.
this.deadline = timed ? System.nanoTime() + nanos : 0L;
from the Phaser. Personally I like the simplicity; but my concern is
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest