/** * Removes an returns the item at the head of the queue. */ public Object dequeue() { if (isEmpty()) return null; Object result = peek(); if (!reuse) elements[head] = null; head = increment(head); return result; }
/** * Removes an returns the item at the head of the queue. */ public Object dequeue() { if (isEmpty()) return null; Object result = peek(); if (!reuse) elements[head] = null; head = increment(head); return result; }
/** * Removes an returns the item at the head of the queue. */ public Object dequeue() { if (isEmpty()) return null; Object result = peek(); if (!reuse) elements[head] = null; head = increment(head); return result; }
/** * Removes an returns the item at the head of the queue. */ public Object dequeue() { if (isEmpty()) return null; Object result = peek(); if (!reuse) elements[head] = null; head = increment(head); return result; }
/** * Releases this lock from the thread that used to own it. * Grants this lock to the next thread in the queue. */ private synchronized void doRelease() { //notify hook manager.aboutToRelease(); depth = 0; Semaphore next = (Semaphore) operations.peek(); setCurrentOperationThread(null); if (next != null) next.release(); }
/** * Releases this lock from the thread that used to own it. * Grants this lock to the next thread in the queue. */ private synchronized void doRelease() { //notify hook manager.aboutToRelease(); depth = 0; Semaphore next = (Semaphore) operations.peek(); setCurrentOperationThread(null); if (next != null) next.release(); }
/** * Releases this lock from the thread that used to own it. * Grants this lock to the next thread in the queue. */ private synchronized void doRelease() { //notify hook manager.aboutToRelease(); depth = 0; Semaphore next = (Semaphore) operations.peek(); setCurrentOperationThread(null); if (next != null) next.release(); }
/** * Releases this lock from the thread that used to own it. * Grants this lock to the next thread in the queue. */ private synchronized void doRelease() { //notify hook manager.aboutToRelease(); depth = 0; Semaphore next = (Semaphore) operations.peek(); setCurrentOperationThread(null); if (next != null) next.release(); }