MCPcopy Create free account
hub / github.com/alibaba/PhotonLibOS / dtor

Method dtor

thread/thread-pool.cpp:153–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151 return 0;
152 }
153 int ThreadPoolBase::dtor(ThreadPoolBase* tpb, TPControl* pCtrl)
154 {
155 {
156 SCOPED_LOCK(pCtrl->m_mtx);
157 if (pCtrl->start) { // it's running
158 assert(pCtrl->start != &stub);
159 pCtrl->joinable = true;
160 pCtrl->m_mtx.unlock();
161 tpb->join(pCtrl);
162 pCtrl->m_mtx.lock();
163 }
164 pCtrl->start = &stub;
165 pCtrl->cvar.notify_all();
166 }
167 thread_yield();
168 return 0;
169 }
170}

Callers 1

deallocate_tlsFunction · 0.45

Calls 5

thread_yieldFunction · 0.85
unlockMethod · 0.45
joinMethod · 0.45
lockMethod · 0.45
notify_allMethod · 0.45

Tested by

no test coverage detected