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