Fix crash in RediSearch
Former-commit-id: 6b6e6f6c1ef49f87f794de512489e5fbbfb67ca0
This commit is contained in:
parent
ce96c69719
commit
8d36bab0e1
@ -3930,6 +3930,8 @@ void RM_FreeThreadSafeContext(RedisModuleCtx *ctx) {
|
|||||||
void RM_ThreadSafeContextLock(RedisModuleCtx *ctx) {
|
void RM_ThreadSafeContextLock(RedisModuleCtx *ctx) {
|
||||||
UNUSED(ctx);
|
UNUSED(ctx);
|
||||||
moduleAcquireGIL(FALSE /*fServerThread*/);
|
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. */
|
/* Release the server lock after a thread safe API call was executed. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user