diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-02-25 20:16:15 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-02-25 20:16:15 +0000 |
commit | f2334416e7485ff1c260a46ba47aeadffeff923a (patch) | |
tree | d4d562a3c0c4af27ed23e9602cad653f1d4fec00 /src/os/unix | |
parent | 14dab4563898155799a06007fff9c30c4dac8b26 (diff) | |
download | nginx-f2334416e7485ff1c260a46ba47aeadffeff923a.tar.gz nginx-f2334416e7485ff1c260a46ba47aeadffeff923a.zip |
nginx-0.0.2-2004-02-25-23:16:15 import
Diffstat (limited to 'src/os/unix')
-rw-r--r-- | src/os/unix/ngx_freebsd_rfork_thread.c | 15 | ||||
-rw-r--r-- | src/os/unix/ngx_thread.h | 4 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/os/unix/ngx_freebsd_rfork_thread.c b/src/os/unix/ngx_freebsd_rfork_thread.c index 7e28b0da5..4ea8b4c6c 100644 --- a/src/os/unix/ngx_freebsd_rfork_thread.c +++ b/src/os/unix/ngx_freebsd_rfork_thread.c @@ -147,7 +147,7 @@ int ngx_create_thread(ngx_tid_t *tid, int (*func)(void *arg), void *arg, } -ngx_int_t ngx_init_threads(int n, size_t size, ngx_log_t *log) +ngx_int_t ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle) { size_t len; char *red_zone, *zone; @@ -156,7 +156,7 @@ ngx_int_t ngx_init_threads(int n, size_t size, ngx_log_t *log) len = sizeof(usrstack); if (sysctlbyname("kern.usrstack", &usrstack, &len, NULL, 0) == -1) { - ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, "sysctlbyname(kern.usrstack) failed"); return NGX_ERROR; } @@ -164,13 +164,13 @@ ngx_int_t ngx_init_threads(int n, size_t size, ngx_log_t *log) /* the main thread stack red zone */ red_zone = usrstack - (size + rz_size); - ngx_log_debug2(NGX_LOG_DEBUG_CORE, log, 0, + ngx_log_debug2(NGX_LOG_DEBUG_CORE, cycle->log, 0, "usrstack: " PTR_FMT " red zone: " PTR_FMT, usrstack, red_zone); zone = mmap(red_zone, rz_size, PROT_NONE, MAP_ANON, -1, 0); if (zone == MAP_FAILED) { - ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, "mmap(" PTR_FMT ":" SIZE_T_FMT ", PROT_NONE, MAP_ANON) red zone failed", red_zone, rz_size); @@ -178,18 +178,19 @@ ngx_int_t ngx_init_threads(int n, size_t size, ngx_log_t *log) } if (zone != red_zone) { - ngx_log_error(NGX_LOG_ALERT, log, 0, "red zone address was changed"); + ngx_log_error(NGX_LOG_ALERT, cycle->log, 0, + "red zone address was changed"); } /* create the threads errno array */ - if (!(errnos = ngx_calloc(n * sizeof(int), log))) { + if (!(errnos = ngx_calloc(n * sizeof(int), cycle->log))) { return NGX_ERROR; } /* create the threads tid array */ - if (!(tids = ngx_calloc((n + 1) * sizeof(ngx_tid_t), log))) { + if (!(tids = ngx_calloc((n + 1) * sizeof(ngx_tid_t), cycle->log))) { return NGX_ERROR; } diff --git a/src/os/unix/ngx_thread.h b/src/os/unix/ngx_thread.h index 9637fda85..3ecc1e62a 100644 --- a/src/os/unix/ngx_thread.h +++ b/src/os/unix/ngx_thread.h @@ -7,7 +7,7 @@ #if (NGX_THREADS) -#if (USE_RFORK) +#if (NGX_USE_RFORK) #include <sys/ipc.h> #include <sys/sem.h> @@ -46,7 +46,7 @@ typedef pthread_t ngx_tid_t; #endif -ngx_int_t ngx_init_threads(int n, size_t size, ngx_log_t *log); +ngx_int_t ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle); int ngx_create_thread(ngx_tid_t *tid, int (*func)(void *arg), void *arg, ngx_log_t *log); ngx_tid_t ngx_thread_self(); |