Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auto/threads9
-rw-r--r--src/core/ngx_config.h6
-rw-r--r--src/event/modules/ngx_rtsig_module.c9
-rw-r--r--src/os/unix/ngx_process_cycle.c2
-rw-r--r--src/os/unix/ngx_thread.h4
5 files changed, 26 insertions, 4 deletions
diff --git a/auto/threads b/auto/threads
index 8f7e10bfc..301dacfe0 100644
--- 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
index a6e5b092a..6e381f50d 100644
--- 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
index 9d1e1b9c3..517c1a0a1 100644
--- 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_cycle_t *cycle)
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_cycle_t *cycle)
} 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_cycle_t *cycle)
"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
index 433c4f073..83b8da8c2 100644
--- 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(void *data)
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
index eb5c33f85..b779de060 100644
--- a/src/os/unix/ngx_thread.h
+++ b/src/os/unix/ngx_thread.h
@@ -22,7 +22,11 @@ typedef pthread_t ngx_tid_t;
#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;