]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
acquire lock. Helps with #5111
authorAlan T. DeKok <aland@freeradius.org>
Fri, 25 Aug 2023 21:59:59 +0000 (17:59 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 25 Aug 2023 21:59:59 +0000 (17:59 -0400)
src/modules/rlm_python3/rlm_python3.c

index db8f0cfb4371f35a80f59bd174a1652ebb92ab1f..817bf33749f74ef0481cec37de8278fcb74962ef 100644 (file)
@@ -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());