| 7710 | q->queued++; |
| 7711 | pthread_cond_signal(&q->not_empty); |
| 7712 | pthread_mutex_unlock(&q->mu); |
| 7713 | return true; |
| 7714 | } |
| 7715 | |
| 7716 | static ds4_dist_worker_job *dist_worker_job_queue_pop(ds4_dist_worker_job_queue *q) { |
| 7717 | pthread_mutex_lock(&q->mu); |
| 7718 | while (!q->head && !q->closed && !q->canceled) { |
| 7719 | pthread_cond_wait(&q->not_empty, &q->mu); |
| 7720 | } |
| 7721 | if (q->canceled || !q->head) { |
| 7722 | pthread_mutex_unlock(&q->mu); |
| 7723 | return NULL; |
| 7724 | } |
| 7725 | ds4_dist_worker_job *job = q->head; |
| 7726 | q->head = job->next; |
| 7727 | if (!q->head) q->tail = NULL; |
| 7728 | q->queued--; |
| 7729 | job->next = NULL; |
| 7730 | pthread_cond_signal(&q->not_full); |
| 7731 | pthread_mutex_unlock(&q->mu); |
| 7732 | return job; |
| 7733 | } |
| 7734 | |
| 7735 | static void *dist_worker_prefetch_eval_main(void *arg) { |
nothing calls this directly
no test coverage detected