diff src/os/unix/ngx_freebsd_rfork_thread.c @ 377:41437e4fd9b4

nginx-0.0.7-2004-07-05-19:08:23 import
author Igor Sysoev <igor@sysoev.ru>
date Mon, 05 Jul 2004 15:08:23 +0000
parents d0451e402e27
children 73688d5d7fc3
line wrap: on
line diff
--- a/src/os/unix/ngx_freebsd_rfork_thread.c
+++ b/src/os/unix/ngx_freebsd_rfork_thread.c
@@ -676,14 +676,24 @@ ngx_int_t ngx_cond_wait(ngx_cond_t *cv, 
 
 ngx_int_t ngx_cond_signal(ngx_cond_t *cv)
 {
+    ngx_err_t  err;
+
     ngx_log_debug3(NGX_LOG_DEBUG_CORE, cv->log, 0,
                    "cv " PTR_FMT " to signal " PID_T_FMT " %d",
                    cv, cv->tid, cv->signo);
 
     if (kill(cv->tid, cv->signo) == -1) {
-        ngx_log_error(NGX_LOG_ALERT, cv->log, ngx_errno,
+
+        err = ngx_errno;
+
+        ngx_log_error(NGX_LOG_ALERT, cv->log, err,
                       "kill() failed while signaling condition variable "
                       PTR_FMT, cv);
+
+        if (err == NGX_ESRCH) {
+            cv->tid = -1;
+        }
+
         return NGX_ERROR;
     }