MCPcopy Create free account
hub / github.com/OpenStarbound/OpenStarbound / stop

Method stop

source/core/StarWorkerPool.cpp:70–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70void WorkerPool::stop() {
71 MutexLocker threadLock(m_threadMutex);
72 for (auto const& workerThread : m_workerThreads)
73 workerThread->shouldStop = true;
74
75 {
76 // Must hold the work lock while broadcasting to ensure that any worker
77 // threads that might wait without stopping actually get the signal.
78 MutexLocker workLock(m_workMutex);
79 m_workCondition.broadcast();
80 }
81
82 m_workerThreads.clear();
83}
84
85void WorkerPool::finish() {
86 // This is kind of a weird way to "wait" until all the pending work is

Callers

nothing calls this directly

Calls 2

broadcastMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected