MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / jobqueue_init

Function jobqueue_init

src/util/thpool/thpool.c:461–477  ·  view source on GitHub ↗

Initialize queue */

Source from the content-addressed store, hash-verified

459
460/* Initialize queue */
461static int jobqueue_init(jobqueue *jobqueue_p) {
462 jobqueue_p->len = 0;
463 jobqueue_p->front = NULL;
464 jobqueue_p->rear = NULL;
465
466 jobqueue_p->has_jobs = (struct bsem *)rm_calloc(1, sizeof(struct bsem));
467 if(jobqueue_p->has_jobs == NULL) {
468 return -1;
469 }
470
471 pthread_mutex_init(&(jobqueue_p->rwmutex), NULL);
472 bsem_init(jobqueue_p->has_jobs, 0);
473
474 jobqueue_p->cap = UINT64_MAX; // unlimited queue size
475
476 return 0;
477}
478
479/* Clear the queue */
480static void jobqueue_clear(jobqueue *jobqueue_p) {

Callers 1

thpool_initFunction · 0.85

Calls 2

rm_callocFunction · 0.85
bsem_initFunction · 0.85

Tested by

no test coverage detected