From 662d5faa8bdd6e1ab5279a9ea0343877125eb75e Mon Sep 17 00:00:00 2001 From: VivekSainiEQ Date: Sat, 27 Mar 2021 00:58:44 +0000 Subject: [PATCH] now acquire and release GIL every time you go to/wake from sleep Former-commit-id: a6bc34c09b58f8c87da1611cd89638245d428a96 --- src/server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index 50e41af2c..48b0cf89d 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -2401,7 +2401,7 @@ void beforeSleep(struct aeEventLoop *eventLoop) { locker.disarm(); if (!fSentReplies) handleClientsWithPendingWrites(iel, aof_state); - if (moduleCount()) moduleReleaseGIL(TRUE /*fServerThread*/); + moduleReleaseGIL(TRUE /*fServerThread*/); /* Do NOT add anything below moduleReleaseGIL !!! */ } @@ -2414,7 +2414,7 @@ void afterSleep(struct aeEventLoop *eventLoop) { /* Do NOT add anything above moduleAcquireGIL !!! */ /* Aquire the modules GIL so that their threads won't touch anything. */ - if (moduleCount()) moduleAcquireGIL(TRUE /*fServerThread*/); + moduleAcquireGIL(TRUE /*fServerThread*/); } /* =========================== Server initialization ======================== */