public final void addAll(Collection<T> c) { writeLock(); try { _queue.addAll(c); } finally { writeUnlock(); } }
public final void add(T t) { writeLock(); try { _queue.add(t); } finally { writeUnlock(); } }
@Override public final void run() { writeLock(); try { _activeTasks.addAll(_queue); _queue.clear(); } finally { writeUnlock(); } for (T task; (task = _activeTasks.pollFirst()) != null; ) { final long begin = System.nanoTime(); try { callTask(task); } catch (RuntimeException e) { _log.warn("", e); } finally { RunnableStatsManager.handleStats( task.getClass(), getCalledMethodName(), System.nanoTime() - begin); } } }