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

Function Cron_Stop

src/cron/cron.c:240–259  ·  view source on GitHub ↗

stops CRON clears all tasks and waits for thread to terminate

Source from the content-addressed store, hash-verified

238// stops CRON
239// clears all tasks and waits for thread to terminate
240void Cron_Stop(void) {
241 ASSERT(cron != NULL);
242
243 // stop cron main loop
244 cron->alive = false;
245 CRON_WakeUp();
246
247 // wait for thread to terminate
248 pthread_join(cron->thread, NULL);
249
250 clear_tasks();
251
252 // free resources
253 Heap_free(cron->tasks);
254 pthread_mutex_destroy(&cron->mutex);
255 pthread_mutex_destroy(&cron->condv_mutex);
256 pthread_cond_destroy(&cron->condv);
257 rm_free(cron);
258 cron = NULL;
259}
260
261// create a new CRON task
262CronTaskHandle Cron_AddTask

Callers 2

_ShutdownEventHandlerFunction · 0.85
tearDownFunction · 0.85

Calls 4

CRON_WakeUpFunction · 0.85
clear_tasksFunction · 0.85
Heap_freeFunction · 0.85
rm_freeFunction · 0.85

Tested by 1

tearDownFunction · 0.68