From: Alan T. DeKok Date: Fri, 25 Aug 2023 21:59:59 +0000 (-0400) Subject: acquire lock. Helps with #5111 X-Git-Tag: release_3_2_4~150 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ecd3d04f51b0ee151a59d1b7602bb91309cb6ce7;p=thirdparty%2Ffreeradius-server.git acquire lock. Helps with #5111 --- diff --git a/src/modules/rlm_python3/rlm_python3.c b/src/modules/rlm_python3/rlm_python3.c index db8f0cfb437..817bf33749f 100644 --- a/src/modules/rlm_python3/rlm_python3.c +++ b/src/modules/rlm_python3/rlm_python3.c @@ -1135,6 +1135,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());