MCPcopy Create free account
hub / github.com/ElementsProject/elements / StartWorkerThreads

Method StartWorkerThreads

src/checkqueue.h:143–159  ·  view source on GitHub ↗

Create a pool of new worker threads.

Source from the content-addressed store, hash-verified

141
142 //! Create a pool of new worker threads.
143 void StartWorkerThreads(const int threads_num)
144 {
145 {
146 LOCK(m_mutex);
147 nIdle = 0;
148 nTotal = 0;
149 fAllOk = true;
150 }
151 assert(m_worker_threads.empty());
152 for (int n = 0; n < threads_num; ++n) {
153 m_worker_threads.emplace_back([this, n]() {
154 util::ThreadRename(strprintf("scriptch.%i", n));
155 SetSyscallSandboxPolicy(SyscallSandboxPolicy::VALIDATION_SCRIPT_CHECK);
156 Loop(false /* worker thread */);
157 });
158 }
159 }
160
161 //! Wait until execution finishes, and return whether all evaluations were successful.
162 bool Wait()

Callers 5

Correct_Queue_rangeFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80
BOOST_AUTO_TEST_CASEFunction · 0.80

Calls 3

SetSyscallSandboxPolicyFunction · 0.85
emplace_backMethod · 0.80
emptyMethod · 0.45

Tested by 3

Correct_Queue_rangeFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64
BOOST_AUTO_TEST_CASEFunction · 0.64