private synchronized EventBuffer swap(EventBuffer buffer) { if (queue.isEmpty() || !running) { flushPending = false; return null; } EventBuffer toReturn = queue; queue = buffer; return toReturn; } }
private synchronized EventBuffer swap(EventBuffer buffer) { if (queue.isEmpty() || !running) { flushPending = false; return null; } EventBuffer toReturn = queue; queue = buffer; return toReturn; } }
public boolean isEmpty() { _lock.lock(); try { return _queue.isEmpty(); } finally { _lock.unlock(); } } }
public boolean isEmpty() { _lock.lock(); try { return _queue.isEmpty(); } finally { _lock.unlock(); } } }
public boolean isEmpty() { _lock.lock(); try { return _queue.isEmpty(); } finally { _lock.unlock(); } } }
public boolean isEmpty() { _lock.lock(); try { return _queue.isEmpty(); } finally { _lock.unlock(); } } }
public EventBuffer swap(EventBuffer buffer) { _lock.lock(); try { while (_queue.isEmpty() && _running) { try { _waiter.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } } EventBuffer toReturn = _queue; _queue = buffer; return toReturn; } finally { _lock.unlock(); } }
public EventBuffer swap(EventBuffer buffer) { _lock.lock(); try { while (_queue.isEmpty() && _running) { try { _waiter.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } } EventBuffer toReturn = _queue; _queue = buffer; return toReturn; } finally { _lock.unlock(); } }
public EventBuffer swap(EventBuffer buffer) { _lock.lock(); try { while (_queue.isEmpty() && _running) { try { empty.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } } EventBuffer toReturn = _queue; _queue = buffer; full.signalAll(); return toReturn; } finally { _lock.unlock(); } }
public EventBuffer swap(EventBuffer buffer) { _lock.lock(); try { while (_queue.isEmpty() && _running) { try { empty.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } } EventBuffer toReturn = _queue; _queue = buffer; full.signalAll(); return toReturn; } finally { _lock.unlock(); } }