Queues a task for serial execution. @param command the task to execute
(Runnable command)
| 339 | * @param command the task to execute |
| 340 | */ |
| 341 | @Override |
| 342 | public void execute(Runnable command) { |
| 343 | if (shutdown) throw new RejectedExecutionException("shutdown"); |
| 344 | queue.add(command); |
| 345 | scheduleNext(); |
| 346 | } |
| 347 | |
| 348 | private void scheduleNext() { |
| 349 | if (!queue.isEmpty() && active.compareAndSet(false, true)) { |
no test coverage detected