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

Function bsem_init

src/util/thpool/thpool.c:554–562  ·  view source on GitHub ↗

Init semaphore to 1 or 0 */

Source from the content-addressed store, hash-verified

552
553/* Init semaphore to 1 or 0 */
554static void bsem_init(bsem *bsem_p, int value) {
555 if(value < 0 || value > 1) {
556 err("bsem_init(): Binary semaphore can take only values 1 or 0");
557 exit(1);
558 }
559 pthread_mutex_init(&(bsem_p->mutex), NULL);
560 pthread_cond_init(&(bsem_p->cond), NULL);
561 bsem_p->v = value;
562}
563
564/* Reset semaphore to 0 */
565static void bsem_reset(bsem *bsem_p) {

Callers 2

jobqueue_initFunction · 0.85
bsem_resetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected