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

Function unregister_thread_end_handler

dlib/threads/threads_kernel_shared.h:250–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

248 typename T
249 >
250 inline void unregister_thread_end_handler (
251 T& obj,
252 void (T::*handler)()
253 )
254 {
255 // Check if the thread pool has been destroyed and if it has then don't do anything.
256 // This bool here is always true except when the program has started to terminate and
257 // the thread pool object has been destroyed. This if is here to catch other global
258 // objects that have destructors that try to call unregister_thread_end_handler().
259 // Without this check we get into trouble if the thread pool is destroyed before these
260 // objects.
261 if (threads_kernel_shared::thread_pool_has_been_destroyed == false)
262 threads_kernel_shared::thread_pool().unregister_thread_end_handler(obj,handler);
263 }
264
265// ----------------------------------------------------------------------------------------
266

Callers 2

~global_dataMethod · 0.85
~thread_specific_dataMethod · 0.85

Calls 2

thread_poolClass · 0.70

Tested by 1

~thread_specific_dataMethod · 0.68