initialize global variables
| 18 | |
| 19 | // initialize global variables |
| 20 | void Globals_Init(void) { |
| 21 | // expecting Global_Init to be called only once |
| 22 | ASSERT(_globals.graphs_in_keyspace == NULL); |
| 23 | |
| 24 | // initialize |
| 25 | _globals.process_is_child = false; |
| 26 | _globals.graphs_in_keyspace = array_new(GraphContext*, 1); |
| 27 | _globals.command_ctxs = rm_calloc(ThreadPools_ThreadCount() + 1, |
| 28 | sizeof(CommandCtx *)); |
| 29 | |
| 30 | int res = pthread_rwlock_init(&_globals.lock, NULL); |
| 31 | ASSERT(res == 0); |
| 32 | } |
| 33 | |
| 34 | // read global variable 'process_is_child' |
| 35 | bool Globals_Get_ProcessIsChild(void) { |
no test coverage detected