| 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 | |