Pause all threads in threadpool */
| 230 | |
| 231 | /* Pause all threads in threadpool */ |
| 232 | void thpool_pause(thpool_* thpool_p) { |
| 233 | int n; |
| 234 | pthread_t caller = pthread_self(); |
| 235 | |
| 236 | for(n = 0; n < thpool_p->num_threads_alive; n++) { |
| 237 | // do not pause caller |
| 238 | if(thpool_p->threads[n]->pthread != caller) { |
| 239 | pthread_kill(thpool_p->threads[n]->pthread, SIGUSR2); |
| 240 | } |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | /* Resume all threads in threadpool */ |
| 245 | void thpool_resume(thpool_* thpool_p) { |