MCPcopy Create free account
hub / github.com/davisking/dlib / thread_pool_implementation

Method thread_pool_implementation

dlib/threads/thread_pool_extension.cpp:14–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12// ----------------------------------------------------------------------------------------
13
14 thread_pool_implementation::
15 thread_pool_implementation (
16 unsigned long num_threads
17 ) :
18 task_done_signaler(m),
19 task_ready_signaler(m),
20 we_are_destructing(false)
21 {
22 tasks.resize(num_threads);
23 threads.resize(num_threads);
24 for (unsigned long i = 0; i < num_threads; ++i)
25 {
26 threads[i] = std::thread([&](){this->thread();});
27 }
28 }
29
30// ----------------------------------------------------------------------------------------
31

Callers

nothing calls this directly

Calls 3

threadFunction · 0.50
resizeMethod · 0.45
threadMethod · 0.45

Tested by

no test coverage detected