/** * must hold statelock while calling this method. * @param wt */ protected void startWorker(Worker wt) { final Thread thread = threadFactory.newThread(wt); thread.setName(getName() + "(" + nextThreadId() + ")"); thread.setUncaughtExceptionHandler(this); thread.setPriority(getPriority()); thread.setDaemon(true); if (thread instanceof WorkerThreadImpl) { final WorkerThreadImpl workerThread = (WorkerThreadImpl) thread; workerThread.setByteBufferType(getByteBufferType()); workerThread.setInitialByteBufferSize(getInitialByteBufferSize()); } wt.t = thread; workers.put(wt, System.currentTimeMillis()); wt.t.start(); }
public Thread newThread(Runnable r) { return new WorkerThreadImpl(AbstractThreadPool.this, getName() + "-WorkerThread(" + nextThreadId() + ")", r, getInitialByteBufferSize()); } };