From: Alan T. DeKok Date: Fri, 25 Aug 2023 22:02:18 +0000 (-0400) Subject: acquire lock for python 2, also X-Git-Tag: release_3_2_4~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=801f4c4010f5170844a6ca868fa8a37e661dda36;p=thirdparty%2Ffreeradius-server.git acquire lock for python 2, also --- diff --git a/src/modules/rlm_python/rlm_python.c b/src/modules/rlm_python/rlm_python.c index 2adba0e5f61..1578df056fc 100644 --- a/src/modules/rlm_python/rlm_python.c +++ b/src/modules/rlm_python/rlm_python.c @@ -1023,6 +1023,8 @@ static int python_interpreter_init(rlm_python_t *inst, CONF_SECTION *conf) Py_InitializeEx(0); /* Don't override signal handlers - noop on subs calls */ PyEval_InitThreads(); /* This also grabs a lock (which we then need to release) */ main_interpreter = PyThreadState_Get(); /* Store reference to the main interpreter */ + } else { + PyEval_AcquireLock(); } rad_assert(PyEval_ThreadsInitialized());