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

Function _DelegateWriter

src/commands/cmd_query.c:437–461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437static void _DelegateWriter(GraphQueryCtx *gq_ctx) {
438 ASSERT(gq_ctx != NULL);
439
440 //---------------------------------------------------------------------------
441 // Migrate to writer thread
442 //---------------------------------------------------------------------------
443
444 // write queries will be executed on a dedicated writer thread,
445 // clear this thread data
446 ErrorCtx_Clear();
447 QueryCtx_RemoveFromTLS();
448
449 // untrack the CommandCtx
450 Globals_UntrackCommandCtx(gq_ctx->command_ctx);
451
452 // update execution thread to writer
453 gq_ctx->command_ctx->thread = EXEC_THREAD_WRITER;
454
455 // reset query stage from executing back to waiting
456 QueryCtx_ResetStage(gq_ctx->query_ctx);
457
458 // dispatch work to the writer thread
459 int res = ThreadPools_AddWorkWriter(_ExecuteQuery, gq_ctx, 0);
460 ASSERT(res == 0);
461}
462
463void _query
464(

Callers 1

_queryFunction · 0.85

Calls 5

ErrorCtx_ClearFunction · 0.85
QueryCtx_RemoveFromTLSFunction · 0.85
QueryCtx_ResetStageFunction · 0.85

Tested by

no test coverage detected