diff src/event/ngx_event_posted.c @ 376:d0451e402e27

nginx-0.0.7-2004-07-05-10:55:54 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 05 Jul 2004 06:55:54 +0000
parents 744ccb59062d
children 41437e4fd9b4
line wrap: on
line diff
--- a/src/event/ngx_event_posted.c
+++ b/src/event/ngx_event_posted.c
@@ -8,7 +8,6 @@ ngx_thread_volatile ngx_event_t  *ngx_po
 
 #if (NGX_THREADS)
 ngx_mutex_t                      *ngx_posted_events_mutex;
-ngx_cond_t                       *ngx_posted_events_cv;
 #endif
 
 
@@ -57,6 +56,19 @@ void ngx_event_process_posted(ngx_cycle_
 
 #if (NGX_THREADS)
 
+void ngx_wakeup_worker_thread(ngx_cycle_t *cycle)
+{
+    ngx_int_t  i;
+
+    for (i = 0; i < ngx_threads_n; i++) {
+        if (ngx_threads[i].state == NGX_THREAD_FREE) {
+            ngx_cond_signal(ngx_threads[i].cv);
+            return;
+        }
+    }
+}
+
+
 ngx_int_t ngx_event_thread_process_posted(ngx_cycle_t *cycle)
 {
     ngx_event_t  *ev;
@@ -71,7 +83,6 @@ ngx_int_t ngx_event_thread_process_poste
                           "posted event " PTR_FMT, ev);
 
             if (ev == NULL) {
-                ngx_mutex_unlock(ngx_posted_events_mutex);
                 return NGX_OK;
             }
 
@@ -144,4 +155,10 @@ ngx_int_t ngx_event_thread_process_poste
     }
 }
 
+#else
+
+void ngx_wakeup_worker_thread(ngx_cycle_t *cycle)
+{
+}
+
 #endif