# HG changeset patch # User Igor Sysoev # Date 1089229711 0 # Node ID 449c4885dcd14d01f2bdb86b47c2b36591be5f40 # Parent 02a511569afb683a42f9e0351c405c0145456fd5 nginx-0.0.7-2004-07-07-23:48:31 import diff --git a/auto/threads b/auto/threads --- a/auto/threads +++ b/auto/threads @@ -30,6 +30,15 @@ case $USE_THREADS in CORE_LIBS="$CORE_LIBS -pthread" ;; + linuxthreads) + have=NGX_THREADS . auto/have + have=NGX_LINUXTHREADS . auto/have + CFLAGS="$CFLAGS -D_THREAD_SAFE" + CFLAGS="$CFLAGS -I /usr/local/include/pthread/linuxthreads" + CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS" + CORE_LIBS="$CORE_LIBS -L /usr/local/lib -llthread -llgcc_r" + ;; + lc_r) have=NGX_THREADS . auto/have CORE_SRCS="$CORE_SRCS $PTHREAD_SRCS" diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h --- a/src/core/ngx_config.h +++ b/src/core/ngx_config.h @@ -41,8 +41,14 @@ #define NGX_TERMINATE_SIGNAL TERM #define NGX_NOACCEPT_SIGNAL WINCH #define NGX_RECONFIGURE_SIGNAL HUP + +#if (NGX_LINUXTHREADS) +#define NGX_REOPEN_SIGNAL INFO +#define NGX_CHANGEBIN_SIGNAL XCPU +#else #define NGX_REOPEN_SIGNAL USR1 #define NGX_CHANGEBIN_SIGNAL USR2 +#endif #endif diff --git a/src/event/modules/ngx_rtsig_module.c b/src/event/modules/ngx_rtsig_module.c --- a/src/event/modules/ngx_rtsig_module.c +++ b/src/event/modules/ngx_rtsig_module.c @@ -363,6 +363,9 @@ ngx_int_t ngx_rtsig_process_events(ngx_c if (signo == -1) { err = ngx_errno; + ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, err, + "rtsig signo:%d", signo); + if (err == NGX_EAGAIN) { if (timer == NGX_TIMER_INFINITE) { @@ -377,6 +380,9 @@ ngx_int_t ngx_rtsig_process_events(ngx_c } else { err = 0; + ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0, + "rtsig signo:%d fd:%d band:%X", + signo, si.si_fd, si.si_band); } ngx_gettimeofday(&tv); @@ -399,9 +405,6 @@ ngx_int_t ngx_rtsig_process_events(ngx_c "rtsig timer: %d, delta: %d", timer, (int) delta); } - ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0, - "rtsig signo:%d fd:%d band:%X", signo, si.si_fd, si.si_band); - rtscf = ngx_event_get_conf(ngx_cycle->conf_ctx, ngx_rtsig_module); if (signo == rtscf->signo || signo == rtscf->signo + 1) { diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c --- a/src/os/unix/ngx_process_cycle.c +++ b/src/os/unix/ngx_process_cycle.c @@ -858,7 +858,7 @@ static void* ngx_worker_thread_cycle(voi return (void *) 1; } - ngx_log_debug1(NGX_LOG_DEBUG_CORE, cycle->log, ngx_errno, + ngx_log_debug1(NGX_LOG_DEBUG_CORE, cycle->log, 0, "thread " TID_T_FMT " started", ngx_thread_self()); ngx_setthrtitle("worker thread"); diff --git a/src/os/unix/ngx_thread.h b/src/os/unix/ngx_thread.h --- a/src/os/unix/ngx_thread.h +++ b/src/os/unix/ngx_thread.h @@ -22,7 +22,11 @@ typedef pthread_t ngx #define ngx_thread_self() pthread_self() #define ngx_log_tid (int) ngx_thread_self() +#if defined(__FreeBSD__) && !defined(NGX_LINUXTHREADS) #define TID_T_FMT PTR_FMT +#else +#define TID_T_FMT "%d" +#endif typedef pthread_key_t ngx_tls_key_t;