Fix crash in RediSearch

Former-commit-id: 6b6e6f6c1ef49f87f794de512489e5fbbfb67ca0
This commit is contained in:
John Sully 2019-07-29 15:08:41 -04:00
parent ce96c69719
commit 8d36bab0e1

View File

@ -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. */