void cbThreadPool::BatchEnd() { wxMutexLocker lock(m_Mutex); m_batching = false; AwakeNeeded(); }
void cbThreadPool::AddTask(cbThreadedTask *task, bool autodelete) { if (!task) return; wxMutexLocker lock(m_Mutex); m_tasksQueue.push_back(cbThreadedTaskElement(task, autodelete)); m_taskAdded = true; // we are in batch mode, so no need to awake the idle thread // m_workingThreads < m_concurrentThreads means there are some threads in idle mode (no task assigned) if (!m_batching && m_workingThreads < m_concurrentThreads) AwakeNeeded(); }
void cbThreadPool::AddTask(cbThreadedTask *task, bool autodelete) { if (!task) { return; } wxMutexLocker lock(m_Mutex); m_tasksQueue.push_back(cbThreadedTaskElement(task, autodelete)); m_taskAdded = true; if (!m_batching && m_workingThreads < m_concurrentThreads) { AwakeNeeded(); } }