aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix/ngx_freebsd_rfork_thread.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-11-25 16:17:31 +0000
committerIgor Sysoev <igor@sysoev.ru>2004-11-25 16:17:31 +0000
commitf69060481edeaca075669b50e34ca8ec821c2401 (patch)
tree6fa6907cc2fdfe0ac6bcdf7f63e76a7f8b41f33f /src/os/unix/ngx_freebsd_rfork_thread.c
parent865a7de474a13c5f1202f97fac31565f33a5e1a1 (diff)
downloadnginx-f69060481edeaca075669b50e34ca8ec821c2401.tar.gz
nginx-f69060481edeaca075669b50e34ca8ec821c2401.zip
nginx-0.1.9-RELEASE importrelease-0.1.9
*) Bugfix: the proxied request was sent without arguments if the request contains "//", "/./", "/../" or "%XX". *) Bugfix: the large compressed responses may be transferred not completely. *) Bugfix: the files bigger than 2G was not transferred on Linux that does not support sendfile64(). *) Bugfix: while the build configuration on Linux the --with-poll_module parameter was required; the bug had appeared in 0.1.8.
Diffstat (limited to 'src/os/unix/ngx_freebsd_rfork_thread.c')
-rw-r--r--src/os/unix/ngx_freebsd_rfork_thread.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/os/unix/ngx_freebsd_rfork_thread.c b/src/os/unix/ngx_freebsd_rfork_thread.c
index b64325bcd..5dfd46807 100644
--- a/src/os/unix/ngx_freebsd_rfork_thread.c
+++ b/src/os/unix/ngx_freebsd_rfork_thread.c
@@ -381,7 +381,7 @@ ngx_int_t ngx_mutex_dolock(ngx_mutex_t *m, ngx_int_t try)
return NGX_AGAIN;
}
- if (ngx_freebsd_hw_ncpu > 1 && tries++ < 1000) {
+ if (ngx_ncpu > 1 && tries++ < 1000) {
/* the spinlock is used only on the SMP system */
@@ -581,7 +581,7 @@ ngx_cond_t *ngx_cond_init(ngx_log_t *log)
}
cv->signo = NGX_CV_SIGNAL;
- cv->tid = 0;
+ cv->tid = -1;
cv->log = log;
cv->kq = -1;
@@ -640,6 +640,8 @@ ngx_int_t ngx_cond_wait(ngx_cond_t *cv, ngx_mutex_t *m)
ngx_log_error(NGX_LOG_ALERT, cv->log, ngx_errno, "kevent() failed");
return NGX_ERROR;
}
+
+ cv->tid = ngx_thread_self();
}
if (ngx_mutex_unlock(m) == NGX_ERROR) {
@@ -714,6 +716,10 @@ ngx_int_t ngx_cond_signal(ngx_cond_t *cv)
"cv %p to signal %P %d",
cv, cv->tid, cv->signo);
+ if (cv->tid == -1) {
+ return NGX_OK;
+ }
+
if (kill(cv->tid, cv->signo) == -1) {
err = ngx_errno;