void start() { bucketWriteLock.lock(); try { ensureNonExistingThread(); processingWorkerThread = new Thread(processingWorkerRunnable); processingWorkerThread.setName(processingWorkerRunnable.getThreadName()); processingWorkerThread.setDaemon(true); processingWorkerThread.start(); } finally { bucketWriteLock.unlock(); } }
private String getThreadName() { return processingWorkerRunnable.getThreadName(); }
private void ensureNonExistingThread() { if (processingWorkerThread != null) { throw new AssertionError(processingWorkerRunnable.getThreadName()); } }