private boolean isQueueEmpty() { queueLock.lock(); try { return taskQueue.isEmpty(); } finally { queueLock.unlock(); } }