| 435 | } |
| 436 | |
| 437 | static 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 | |
| 463 | void _query |
| 464 | ( |
no test coverage detected