a71a57
a71a57
https://github.com/GrahamDumpleton/mod_wsgi/commit/f8b43b2b79fabdcead4410f1a10484a10608ba6a
a71a57
a71a57
--- mod_wsgi-3.4/mod_wsgi.c.deadlock
a71a57
+++ mod_wsgi-3.4/mod_wsgi.c
a71a57
@@ -11113,8 +11113,10 @@
a71a57
     while (1) {
a71a57
         apr_sleep(apr_time_from_sec(1));
a71a57
 
a71a57
-        gilstate = PyGILState_Ensure();
a71a57
-        PyGILState_Release(gilstate);
a71a57
+        if (!wsgi_daemon_shutdown) {
a71a57
+            gilstate = PyGILState_Ensure();
a71a57
+            PyGILState_Release(gilstate);
a71a57
+        }
a71a57
 
a71a57
         apr_thread_mutex_lock(wsgi_shutdown_lock);
a71a57
         wsgi_deadlock_shutdown_time = apr_time_now();