| 256 | } |
| 257 | |
| 258 | void tq_choke(ThreadQueue *tq, int choked) |
| 259 | { |
| 260 | pthread_mutex_lock(&tq->lock); |
| 261 | |
| 262 | int prev_choked = tq->choked; |
| 263 | tq->choked = choked; |
| 264 | if (choked != prev_choked) |
| 265 | pthread_cond_broadcast(&tq->cond); |
| 266 | |
| 267 | pthread_mutex_unlock(&tq->lock); |
| 268 | } |
no test coverage detected