]> git.kaiwu.me - nginx.git/commitdiff
Win32: accept_mutex now always disabled (ticket #362).
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 31 May 2013 10:59:26 +0000 (14:59 +0400)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 31 May 2013 10:59:26 +0000 (14:59 +0400)
Use of accept mutex on win32 may result in a deadlock if there are multiple
worker_processes configured and the mutex is grabbed by a process which
can't accept connections.

src/event/ngx_event.c

index b7205f45b07c37e6c6733d740597a360b0cc7b8f..c4c61204b78e131024b6d582b3b39c2f5c3bf2f4 100644 (file)
@@ -607,6 +607,17 @@ ngx_event_process_init(ngx_cycle_t *cycle)
         ngx_use_accept_mutex = 0;
     }
 
+#if (NGX_WIN32)
+
+    /*
+     * disable accept mutex on win32 as it may cause deadlock if
+     * grabbed by a process which can't accept connections
+     */
+
+    ngx_use_accept_mutex = 0;
+
+#endif
+
 #if (NGX_THREADS)
     ngx_posted_events_mutex = ngx_mutex_init(cycle->log, 0);
     if (ngx_posted_events_mutex == NULL) {