113114115116117118119120121122123
do { try { Runnable task; ConcurrentLinkedQueue tasks = m_tasks; while ((task = (Runnable) tasks.poll()) != null) { runTask(task); } } finally { m_runningThread.set(null);