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

Function Globals_Init

src/globals.c:20–32  ·  view source on GitHub ↗

initialize global variables

Source from the content-addressed store, hash-verified

18
19// initialize global variables
20void 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'
35bool Globals_Get_ProcessIsChild(void) {

Callers 1

RedisModule_OnLoadFunction · 0.85

Calls 2

rm_callocFunction · 0.85
ThreadPools_ThreadCountFunction · 0.85

Tested by

no test coverage detected