/** * Grows the thread pool by one new thread if the maximum pool size * has not been reached.<p> */ private void growThreadPool() { if (m_currentThreadCount < m_maxThreadCount) { // if maximum number is not reached grow the thread pool synchronized (m_nextRunnableLock) { m_workers[m_currentThreadCount] = new CmsSchedulerThread(this, m_threadGroup, m_threadNamePrefix + m_currentThreadCount, m_threadPriority, m_makeThreadsDaemons); m_workers[m_currentThreadCount].start(); if (m_inheritLoader) { m_workers[m_currentThreadCount].setContextClassLoader(Thread.currentThread().getContextClassLoader()); } // increas the current size m_currentThreadCount++; // notify the waiting threads m_nextRunnableLock.notifyAll(); } } } }
/** * Grows the thread pool by one new thread if the maximum pool size * has not been reached.<p> */ private void growThreadPool() { if (m_currentThreadCount < m_maxThreadCount) { // if maximum number is not reached grow the thread pool synchronized (m_nextRunnableLock) { m_workers[m_currentThreadCount] = new CmsSchedulerThread( this, m_threadGroup, m_threadNamePrefix + m_currentThreadCount, m_threadPriority, m_makeThreadsDaemons); m_workers[m_currentThreadCount].start(); if (m_inheritLoader) { m_workers[m_currentThreadCount].setContextClassLoader( Thread.currentThread().getContextClassLoader()); } // increas the current size m_currentThreadCount++; // notify the waiting threads m_nextRunnableLock.notifyAll(); } } } }