now acquire and release GIL every time you go to/wake from sleep

Former-commit-id: a6bc34c09b58f8c87da1611cd89638245d428a96
This commit is contained in:
VivekSainiEQ 2021-03-27 00:58:44 +00:00 committed by John Sully
parent cb43eda420
commit 662d5faa8b

View File

@ -2401,7 +2401,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
locker.disarm(); locker.disarm();
if (!fSentReplies) if (!fSentReplies)
handleClientsWithPendingWrites(iel, aof_state); handleClientsWithPendingWrites(iel, aof_state);
if (moduleCount()) moduleReleaseGIL(TRUE /*fServerThread*/); moduleReleaseGIL(TRUE /*fServerThread*/);
/* Do NOT add anything below moduleReleaseGIL !!! */ /* Do NOT add anything below moduleReleaseGIL !!! */
} }
@ -2414,7 +2414,7 @@ void afterSleep(struct aeEventLoop *eventLoop) {
/* Do NOT add anything above moduleAcquireGIL !!! */ /* Do NOT add anything above moduleAcquireGIL !!! */
/* Aquire the modules GIL so that their threads won't touch anything. */ /* Aquire the modules GIL so that their threads won't touch anything. */
if (moduleCount()) moduleAcquireGIL(TRUE /*fServerThread*/); moduleAcquireGIL(TRUE /*fServerThread*/);
} }
/* =========================== Server initialization ======================== */ /* =========================== Server initialization ======================== */