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

Method should_stop

dlib/threads/threaded_object_extension.cpp:234–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232// ----------------------------------------------------------------------------------------
233
234 bool threaded_object::
235 should_stop (
236 ) const
237 {
238 auto_mutex M(m_);
239 DLIB_ASSERT(is_alive_ && id1 == get_thread_id() && id_valid == true,
240 "\tbool threaded_object::should_stop()"
241 << "\n\tYou can only call this function from the thread that executes threaded_object::thread"
242 << "\n\tthis: " << this
243 );
244 while (is_running_ == false && should_stop_ == false)
245 s.wait();
246 return should_stop_;
247 }
248
249// ----------------------------------------------------------------------------------------
250

Callers

nothing calls this directly

Calls 2

get_thread_idFunction · 0.70
waitMethod · 0.45

Tested by

no test coverage detected