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

Method start

dlib/threads/multithreaded_object_extension.cpp:111–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109// ----------------------------------------------------------------------------------------
110
111 void multithreaded_object::
112 start (
113 )
114 {
115 auto_mutex M(m_);
116 const unsigned long num_threads_registered = dead_threads.size() + thread_ids.size();
117 // start any dead threads
118 for (unsigned long i = threads_started; i < num_threads_registered; ++i)
119 {
120 if (create_new_thread<multithreaded_object,&multithreaded_object::thread_helper>(*this) == false)
121 {
122 should_stop_ = true;
123 is_running_ = false;
124 throw thread_error();
125 }
126 ++threads_started;
127 }
128 is_running_ = true;
129 should_stop_ = false;
130 s.broadcast();
131 }
132
133// ----------------------------------------------------------------------------------------
134

Callers

nothing calls this directly

Calls 3

thread_errorClass · 0.85
sizeMethod · 0.45
broadcastMethod · 0.45

Tested by

no test coverage detected