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

Function Globals_UntrackCommandCtx

src/globals.c:223–243  ·  view source on GitHub ↗

untrack CommandCtx

Source from the content-addressed store, hash-verified

221
222// untrack CommandCtx
223void Globals_UntrackCommandCtx
224(
225 const CommandCtx *ctx // CommandCtx to untrack
226) {
227 ASSERT(ctx != NULL);
228 ASSERT(_globals.command_ctxs != NULL);
229
230 int tid = ThreadPools_GetThreadID();
231
232 // acuire read lock
233 pthread_rwlock_rdlock(&_globals.lock);
234
235 ASSERT(_globals.command_ctxs[tid] == ctx);
236
237 // clear ctx at the current thread entry
238 // CommandCtx_Free will free it eventually
239 _globals.command_ctxs[tid] = NULL;
240
241 // release lock
242 pthread_rwlock_unlock(&_globals.lock);
243}
244
245// get all currently tracked CommandCtxs
246void Globals_GetCommandCtxs

Callers 4

_ExecuteQueryFunction · 0.85
_DelegateWriterFunction · 0.85
_queryFunction · 0.85
Graph_ExplainFunction · 0.85

Calls 1

ThreadPools_GetThreadIDFunction · 0.85

Tested by

no test coverage detected