5051525354555657585960
Queue queue = getQueue(); queue.add(event); // enqueue if (queue.size() == 1) { event.run(); queue.poll(); // dequeue current runnable for (Runnable task = null; (task = (Runnable) queue.peek()) != null; queue .poll()) task.run(); } }
5152535455565758596061
queue.add(event); // enqueue if (queue.size() == 1) { event.run(); queue.poll(); // dequeue current runnable for (Runnable task = null; (task = (Runnable) queue.peek()) != null; queue .poll()) task.run(); } } }