Skip to content

Commit

Permalink
Fix crash in RediSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Jul 29, 2019
1 parent b0a0f03 commit 6b6e6f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3930,6 +3930,8 @@ void RM_FreeThreadSafeContext(RedisModuleCtx *ctx) {
void RM_ThreadSafeContextLock(RedisModuleCtx *ctx) {
UNUSED(ctx);
moduleAcquireGIL(FALSE /*fServerThread*/);
if (serverTL == nullptr)
serverTL = &g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN]; // arbitrary module threads get the main thread context
}

/* Release the server lock after a thread safe API call was executed. */
Expand Down

0 comments on commit 6b6e6f6

Please sign in to comment.