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

Function Cron_Start

src/cron/cron.c:221–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219//------------------------------------------------------------------------------
220
221bool Cron_Start(void) {
222 ASSERT(cron == NULL);
223
224 cron = rm_malloc(sizeof(CRON));
225
226 cron->alive = true;
227 cron->tasks = Heap_new(CRON_JobCmp, NULL);
228
229 bool res = true;
230 res &= pthread_cond_init(&cron->condv, NULL) == 0;
231 res &= pthread_mutex_init(&cron->mutex, NULL) == 0;
232 res &= pthread_mutex_init(&cron->condv_mutex, NULL) == 0;
233 res &= pthread_create(&cron->thread, NULL, Cron_Run, NULL) == 0;
234
235 return res;
236}
237
238// stops CRON
239// clears all tasks and waits for thread to terminate

Callers 3

_ModuleLoadedHandlerFunction · 0.85
_Cron_StartFunction · 0.85
setupFunction · 0.85

Calls 2

rm_mallocFunction · 0.85
Heap_newFunction · 0.85

Tested by 1

setupFunction · 0.68