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

Method should_stop

dlib/threads/multithreaded_object_extension.cpp:157–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155// ----------------------------------------------------------------------------------------
156
157 bool multithreaded_object::
158 should_stop (
159 ) const
160 {
161 auto_mutex M(m_);
162 DLIB_ASSERT(thread_ids.is_in_domain(get_thread_id()),
163 "\tbool multithreaded_object::should_stop()"
164 << "\n\tYou can only call this function from one of the registered threads in this object"
165 << "\n\tthis: " << this
166 );
167 while (is_running_ == false && should_stop_ == false)
168 s.wait();
169 return should_stop_;
170 }
171
172// ----------------------------------------------------------------------------------------
173

Callers

nothing calls this directly

Calls 2

get_thread_idFunction · 0.70
waitMethod · 0.45

Tested by

no test coverage detected