protected void newThread() { synchronized (_threadsLock) { if (_threads.size()<_maxThreads) { PoolThread thread =new PoolThread(); _threads.add(thread); thread.setName(_name+"-"+_id++); thread.start(); } else if (!_warned) { _warned=true; Log.debug("Max threads for {}",this); } } }
thread.dispatch(job);
PoolThread() { setDaemon(_daemon); setPriority(_priority); }