public void lockInterruptibly() throws InterruptedException { delegate.lockInterruptibly(); }
/** * {@inheritDoc} */ public void lockInterruptibly() throws InterruptedException { resolvedLock.lockInterruptibly(); if (resolvedLock.getHoldCount() == 1) pin(resolvedLock); }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { try { while (count == 0) notEmpty.await(); } catch (InterruptedException ie) { notEmpty.signal(); // propagate to non-interrupted thread throw ie; } Object x = extract(); return x; } finally { lock.unlock(); } }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { try { while (count == 0) notEmpty.await(); } catch (InterruptedException ie) { notEmpty.signal(); // propagate to non-interrupted thread throw ie; } Object x = extract(); return x; } finally { lock.unlock(); } }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { try { while (count == 0) notEmpty.await(); } catch (InterruptedException ie) { notEmpty.signal(); // propagate to non-interrupted thread throw ie; } Object x = extract(); return x; } finally { lock.unlock(); } }
/** * @throws NullPointerException {@inheritDoc} * @throws InterruptedException {@inheritDoc} */ public boolean offerLast(Object e, long timeout, TimeUnit unit) throws InterruptedException { if (e == null) throw new NullPointerException(); long nanos = unit.toNanos(timeout); long deadline = Utils.nanoTime() + nanos; lock.lockInterruptibly(); try { for (;;) { if (linkLast(e)) return true; if (nanos <= 0) return false; notFull.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } } finally { lock.unlock(); } }
/** * @throws NullPointerException {@inheritDoc} * @throws InterruptedException {@inheritDoc} */ public boolean offerLast(Object e, long timeout, TimeUnit unit) throws InterruptedException { if (e == null) throw new NullPointerException(); long nanos = unit.toNanos(timeout); long deadline = Utils.nanoTime() + nanos; lock.lockInterruptibly(); try { for (;;) { if (linkLast(e)) return true; if (nanos <= 0) return false; notFull.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } } finally { lock.unlock(); } }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { try { while (q.size() == 0) notEmpty.await(); } catch (InterruptedException ie) { notEmpty.signal(); // propagate to non-interrupted thread throw ie; } Object x = q.poll(); assert x != null; return x; } finally { lock.unlock(); } }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { try { while (q.size() == 0) notEmpty.await(); } catch (InterruptedException ie) { notEmpty.signal(); // propagate to non-interrupted thread throw ie; } Object x = q.poll(); //assert x != null; return x; } finally { lock.unlock(); } }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { for (;;) { RunnableScheduledFuture first = queue[0]; if (first == null) available.await(); else { long delay = first.getDelay(TimeUnit.NANOSECONDS); if (delay > 0) available.await(delay, TimeUnit.NANOSECONDS); else return finishPoll(first); } } } finally { lock.unlock(); } }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { for (;;) { RunnableScheduledFuture first = queue[0]; if (first == null) available.await(); else { long delay = first.getDelay(TimeUnit.NANOSECONDS); if (delay > 0) available.await(delay, TimeUnit.NANOSECONDS); else return finishPoll(first); } } } finally { lock.unlock(); } }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { try { while (q.size() == 0) notEmpty.await(); } catch (InterruptedException ie) { notEmpty.signal(); // propagate to non-interrupted thread throw ie; } Object x = q.poll(); assert x != null; return x; } finally { lock.unlock(); } }
public Object take() throws InterruptedException { final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { for (;;) { RunnableScheduledFuture first = queue[0]; if (first == null) available.await(); else { long delay = first.getDelay(TimeUnit.NANOSECONDS); if (delay > 0) available.await(delay, TimeUnit.NANOSECONDS); else return finishPoll(first); } } } finally { lock.unlock(); } }
public Object pollLast(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); long deadline = Utils.nanoTime() + nanos; lock.lockInterruptibly(); try { for (;;) { Object x = unlinkLast(); if (x != null) return x; if (nanos <= 0) return null; notEmpty.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } } finally { lock.unlock(); } }
public Object pollLast(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); long deadline = Utils.nanoTime() + nanos; lock.lockInterruptibly(); try { for (;;) { Object x = unlinkLast(); if (x != null) return x; if (nanos <= 0) return null; notEmpty.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } } finally { lock.unlock(); } }
public Object pollLast(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); long deadline = Utils.nanoTime() + nanos; lock.lockInterruptibly(); try { for (;;) { Object x = unlinkLast(); if (x != null) return x; if (nanos <= 0) return null; notEmpty.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } } finally { lock.unlock(); } }
public Object pollFirst(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); long deadline = Utils.nanoTime() + nanos; lock.lockInterruptibly(); try { for (;;) { Object x = unlinkFirst(); if (x != null) return x; if (nanos <= 0) return null; notEmpty.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } } finally { lock.unlock(); } }
public Object pollFirst(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); long deadline = Utils.nanoTime() + nanos; lock.lockInterruptibly(); try { for (;;) { Object x = unlinkFirst(); if (x != null) return x; if (nanos <= 0) return null; notEmpty.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } } finally { lock.unlock(); } }
public Object pollFirst(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); long deadline = Utils.nanoTime() + nanos; lock.lockInterruptibly(); try { for (;;) { Object x = unlinkFirst(); if (x != null) return x; if (nanos <= 0) return null; notEmpty.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } } finally { lock.unlock(); } }
public Object poll(long timeout, TimeUnit unit) throws InterruptedException { long nanos = unit.toNanos(timeout); final ReentrantLock lock = this.lock; lock.lockInterruptibly(); try { long deadline = Utils.nanoTime() + nanos; for (;;) { Object x = q.poll(); if (x != null) return x; if (nanos <= 0) return null; try { notEmpty.await(nanos, TimeUnit.NANOSECONDS); nanos = deadline - Utils.nanoTime(); } catch (InterruptedException ie) { notEmpty.signal(); // propagate to non-interrupted thread throw ie; } } } finally { lock.unlock(); } }