Fix crash in RediSearch

Former-commit-id: cbe5c04a0f3b0b1886f6c88c0a2401e0e6501b3b
This commit is contained in:
John Sully 2019-07-29 15:08:41 -04:00
parent e3b97286ca
commit 945a7b69f1

View File

@ -3949,6 +3949,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. */