299 |
|
public boolean offerFirst(E e, long timeout, TimeUnit unit) |
300 |
|
throws InterruptedException { |
301 |
|
if (e == null) throw new NullPointerException(); |
302 |
+ |
long nanos = unit.toNanos(timeout); |
303 |
|
lock.lockInterruptibly(); |
304 |
|
try { |
304 |
– |
long nanos = unit.toNanos(timeout); |
305 |
|
for (;;) { |
306 |
|
if (linkFirst(e)) |
307 |
|
return true; |
321 |
|
public boolean offerLast(E e, long timeout, TimeUnit unit) |
322 |
|
throws InterruptedException { |
323 |
|
if (e == null) throw new NullPointerException(); |
324 |
+ |
long nanos = unit.toNanos(timeout); |
325 |
|
lock.lockInterruptibly(); |
326 |
|
try { |
326 |
– |
long nanos = unit.toNanos(timeout); |
327 |
|
for (;;) { |
328 |
|
if (linkLast(e)) |
329 |
|
return true; |
398 |
|
|
399 |
|
public E pollFirst(long timeout, TimeUnit unit) |
400 |
|
throws InterruptedException { |
401 |
+ |
long nanos = unit.toNanos(timeout); |
402 |
|
lock.lockInterruptibly(); |
403 |
|
try { |
403 |
– |
long nanos = unit.toNanos(timeout); |
404 |
|
for (;;) { |
405 |
|
E x = unlinkFirst(); |
406 |
|
if (x != null) |
416 |
|
|
417 |
|
public E pollLast(long timeout, TimeUnit unit) |
418 |
|
throws InterruptedException { |
419 |
+ |
long nanos = unit.toNanos(timeout); |
420 |
|
lock.lockInterruptibly(); |
421 |
|
try { |
421 |
– |
long nanos = unit.toNanos(timeout); |
422 |
|
for (;;) { |
423 |
|
E x = unlinkLast(); |
424 |
|
if (x != null) |