| 260 | } |
| 261 | |
| 262 | int thpool_get_thread_id(thpool_* thpool_p, pthread_t pthread) { |
| 263 | for(int i = 0; i < thpool_p->num_threads_alive; i++) { |
| 264 | thread *thread = thpool_p->threads[i]; |
| 265 | if(thread->pthread == pthread) return thread->id; |
| 266 | } |
| 267 | |
| 268 | // Could not locate thread. |
| 269 | return -1; |
| 270 | } |
| 271 | |
| 272 | // return true if thread pool internal queue is full with pending work |
| 273 | bool thpool_queue_full(thpool_* thpool_p) { |
no outgoing calls
no test coverage detected