comparison src/os/unix/ngx_freebsd_rfork_thread.c @ 469:2ff194b74f1e release-0.1.9

nginx-0.1.9-RELEASE import *) 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.
author Igor Sysoev <igor@sysoev.ru>
date Thu, 25 Nov 2004 16:17:31 +0000
parents a88a3e4e158f
children d4ea69372b94
comparison
equal deleted inserted replaced
468:1a67596d0349 469:2ff194b74f1e
379 379
380 if (try) { 380 if (try) {
381 return NGX_AGAIN; 381 return NGX_AGAIN;
382 } 382 }
383 383
384 if (ngx_freebsd_hw_ncpu > 1 && tries++ < 1000) { 384 if (ngx_ncpu > 1 && tries++ < 1000) {
385 385
386 /* the spinlock is used only on the SMP system */ 386 /* the spinlock is used only on the SMP system */
387 387
388 old = m->lock; 388 old = m->lock;
389 continue; 389 continue;
579 if (!(cv = ngx_alloc(sizeof(ngx_cond_t), log))) { 579 if (!(cv = ngx_alloc(sizeof(ngx_cond_t), log))) {
580 return NULL; 580 return NULL;
581 } 581 }
582 582
583 cv->signo = NGX_CV_SIGNAL; 583 cv->signo = NGX_CV_SIGNAL;
584 cv->tid = 0; 584 cv->tid = -1;
585 cv->log = log; 585 cv->log = log;
586 cv->kq = -1; 586 cv->kq = -1;
587 587
588 return cv; 588 return cv;
589 } 589 }
638 638
639 if (kevent(cv->kq, &kev, 1, NULL, 0, &ts) == -1) { 639 if (kevent(cv->kq, &kev, 1, NULL, 0, &ts) == -1) {
640 ngx_log_error(NGX_LOG_ALERT, cv->log, ngx_errno, "kevent() failed"); 640 ngx_log_error(NGX_LOG_ALERT, cv->log, ngx_errno, "kevent() failed");
641 return NGX_ERROR; 641 return NGX_ERROR;
642 } 642 }
643
644 cv->tid = ngx_thread_self();
643 } 645 }
644 646
645 if (ngx_mutex_unlock(m) == NGX_ERROR) { 647 if (ngx_mutex_unlock(m) == NGX_ERROR) {
646 return NGX_ERROR; 648 return NGX_ERROR;
647 } 649 }
712 714
713 ngx_log_debug3(NGX_LOG_DEBUG_CORE, cv->log, 0, 715 ngx_log_debug3(NGX_LOG_DEBUG_CORE, cv->log, 0,
714 "cv %p to signal %P %d", 716 "cv %p to signal %P %d",
715 cv, cv->tid, cv->signo); 717 cv, cv->tid, cv->signo);
716 718
719 if (cv->tid == -1) {
720 return NGX_OK;
721 }
722
717 if (kill(cv->tid, cv->signo) == -1) { 723 if (kill(cv->tid, cv->signo) == -1) {
718 724
719 err = ngx_errno; 725 err = ngx_errno;
720 726
721 ngx_log_error(NGX_LOG_ALERT, cv->log, err, 727 ngx_log_error(NGX_LOG_ALERT, cv->log, err,