aboutsummaryrefslogtreecommitdiff
path: root/src/os/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/unix')
-rw-r--r--src/os/unix/ngx_freebsd_rfork_thread.c15
-rw-r--r--src/os/unix/ngx_thread.h4
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();