MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / getThread

Method getThread

src/common/Task.cpp:296–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

294}
295
296WorkerThread* Coordinator::getThread()
297{
298 MutexLockGuard guard(m_mutex, FB_FUNCTION);
299 WorkerThread* thd = NULL;
300
301 if (!m_idleThreads.isEmpty())
302 thd = m_idleThreads.pop();
303 else
304 {
305 thd = WorkerThread::start(this);
306 if (thd)
307 thd->waitForState(WorkerThread::IDLE, -1);
308 }
309
310 if (thd)
311 {
312 fb_assert(thd->getState() == WorkerThread::IDLE);
313 m_activeThreads.push(thd);
314 }
315 return thd;
316}
317
318void Coordinator::releaseThread(WorkerThread* thd)
319{

Callers

nothing calls this directly

Calls 6

waitForStateMethod · 0.80
startFunction · 0.50
isEmptyMethod · 0.45
popMethod · 0.45
getStateMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected