MCPcopy Create free account
hub / github.com/antirez/ds4 / dist_worker_prefetch_eval_main

Function dist_worker_prefetch_eval_main

ds4_distributed.c:7712–7732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7710 q->queued++;
7711 pthread_cond_signal(&q->not_empty);
7712 pthread_mutex_unlock(&q->mu);
7713 return true;
7714}
7715
7716static 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
7735static void *dist_worker_prefetch_eval_main(void *arg) {

Callers

nothing calls this directly

Calls 4

dist_worker_job_freeFunction · 0.85

Tested by

no test coverage detected