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

Method start

source/core/StarWorkerPool.cpp:57–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55WorkerPool& WorkerPool::operator=(WorkerPool&&) = default;
56
57void WorkerPool::start(unsigned threadCount) {
58 MutexLocker threadLock(m_threadMutex);
59
60 for (auto const& workerThread : m_workerThreads)
61 workerThread->shouldStop = true;
62
63 m_workCondition.broadcast();
64 m_workerThreads.clear();
65
66 for (size_t i = m_workerThreads.size(); i < threadCount; ++i)
67 m_workerThreads.append(make_unique<WorkerThread>(this));
68}
69
70void WorkerPool::stop() {
71 MutexLocker threadLock(m_threadMutex);

Callers

nothing calls this directly

Calls 4

broadcastMethod · 0.45
clearMethod · 0.45
sizeMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected