예제 #1
0
void cbThreadPool::BatchEnd()
{
    wxMutexLocker lock(m_Mutex);
    m_batching = false;

    AwakeNeeded();
}
예제 #2
0
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();
}
예제 #3
0
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();
    }
}