synchronized void clear() { checkConsumer(); for (int i = data.length; i-- > 0; ) { data[i] = null; } size = 0; }
/** * Dequeue one element from head of the queue, will block if queue is empty * @return the first element * @throws InterruptedException */ synchronized T dequeue() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } return _dequeue(); }
private synchronized T waitForData() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } setConsumerLock(); return front(); }
synchronized void clear() { checkConsumer(); for (int i = data.length; i-- > 0; ) { data[i] = null; } size = 0; }
synchronized void clear() { checkConsumer(); for (int i = data.length; i-- > 0; ) { data[i] = null; } size = 0; }
synchronized void clear() { checkConsumer(); for (int i = data.length; i-- > 0; ) { data[i] = null; } size = 0; }
synchronized void clear() { checkConsumer(); for (int i = data.length; i-- > 0; ) { data[i] = null; } size = 0; }
/** * Dequeue one element from head of the queue, will block if queue is empty * @return the first element * @throws InterruptedException */ synchronized T dequeue() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } return _dequeue(); }
/** * Dequeue one element from head of the queue, will block if queue is empty * @return the first element * @throws InterruptedException */ synchronized T dequeue() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } return _dequeue(); }
/** * Dequeue one element from head of the queue, will block if queue is empty * @return the first element * @throws InterruptedException */ synchronized T dequeue() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } return _dequeue(); }
/** * Dequeue one element from head of the queue, will block if queue is empty * @return the first element * @throws InterruptedException */ synchronized T dequeue() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } return _dequeue(); }
private synchronized T waitForData() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } setConsumerLock(); return front(); }
private synchronized T waitForData() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } setConsumerLock(); return front(); }
private synchronized T waitForData() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } setConsumerLock(); return front(); }
private synchronized T waitForData() throws InterruptedException { checkConsumer(); while (0 == size) { wait(); } setConsumerLock(); return front(); }