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

Method wait_for_task

dlib/threads/thread_pool_extension.cpp:94–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92// ----------------------------------------------------------------------------------------
93
94 void thread_pool_implementation::
95 wait_for_task (
96 uint64 task_id
97 ) const
98 {
99 auto_mutex M(m);
100 if (tasks.size() != 0)
101 {
102 const unsigned long idx = task_id_to_index(task_id);
103 while (tasks[idx].task_id == task_id)
104 task_done_signaler.wait();
105
106 for (auto&& task : tasks)
107 task.propagate_exception();
108 }
109 }
110
111// ----------------------------------------------------------------------------------------
112

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.45
waitMethod · 0.45
propagate_exceptionMethod · 0.45

Tested by

no test coverage detected