File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -329,6 +329,7 @@ static int s_cAcquisitionsServer = 0;
329
329
static int s_cAcquisitionsModule = 0 ;
330
330
static std::mutex s_mutex;
331
331
static std::condition_variable s_cv;
332
+ static std::recursive_mutex s_mutexModule;
332
333
333
334
typedef void (*RedisModuleForkDoneHandler) (int exitcode, int bysignal, void *user_data);
334
335
@@ -5055,6 +5056,7 @@ void moduleAcquireGIL(int fServerThread) {
5055
5056
}
5056
5057
else
5057
5058
{
5059
+ s_mutexModule.lock ();
5058
5060
++s_cAcquisitionsModule;
5059
5061
fModuleGILWlocked ++;
5060
5062
}
@@ -5079,6 +5081,8 @@ int moduleTryAcquireGIL(bool fServerThread) {
5079
5081
}
5080
5082
else
5081
5083
{
5084
+ if (!s_mutexModule.try_lock ())
5085
+ return 1 ;
5082
5086
++s_cAcquisitionsModule;
5083
5087
fModuleGILWlocked ++;
5084
5088
}
@@ -5098,6 +5102,7 @@ void moduleReleaseGIL(int fServerThread) {
5098
5102
}
5099
5103
else
5100
5104
{
5105
+ s_mutexModule.unlock ();
5101
5106
--s_cAcquisitionsModule;
5102
5107
fModuleGILWlocked --;
5103
5108
}
You can’t perform that action at this time.
0 commit comments