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

Method is_worker_thread

dlib/threads/thread_pool_extension.cpp:146–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

144// ----------------------------------------------------------------------------------------
145
146 bool thread_pool_implementation::
147 is_worker_thread (
148 const thread_id_type id
149 ) const
150 {
151 for (unsigned long i = 0; i < worker_thread_ids.size(); ++i)
152 {
153 if (worker_thread_ids[i] == id)
154 return true;
155 }
156
157 // if there aren't any threads in the pool then we consider all threads
158 // to be worker threads
159 if (tasks.size() == 0)
160 return true;
161 else
162 return false;
163 }
164
165// ----------------------------------------------------------------------------------------
166

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected