MCPcopy Create free account
hub / github.com/MariaDB/server / wake

Method wake

tpool/tpool_generic.cc:738–752  ·  view source on GitHub ↗

Wake a standby thread, and hand the given task over to this thread. */

Source from the content-addressed store, hash-verified

736
737/** Wake a standby thread, and hand the given task over to this thread. */
738bool thread_pool_generic::wake(worker_wake_reason reason, task *)
739{
740 assert(reason != WAKE_REASON_NONE);
741
742 if (m_standby_threads.empty())
743 return false;
744 auto var= m_standby_threads.back();
745 m_standby_threads.pop_back();
746 m_active_threads.push_back(var);
747 assert(var->m_wake_reason == WAKE_REASON_NONE);
748 var->m_wake_reason= reason;
749 var->m_cv.notify_one();
750 m_wakeups++;
751 return true;
752}
753
754
755thread_pool_generic::thread_pool_generic(int min_threads, int max_threads) :

Callers

nothing calls this directly

Calls 5

notify_oneMethod · 0.80
emptyMethod · 0.45
backMethod · 0.45
pop_backMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected