mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
Removed "worker_threads" and "thread_stack_size" directives.
This commit is contained in:
parent
324e389e17
commit
64c5df4b62
@ -139,24 +139,6 @@ static ngx_command_t ngx_core_commands[] = {
|
|||||||
0,
|
0,
|
||||||
NULL },
|
NULL },
|
||||||
|
|
||||||
#if (NGX_OLD_THREADS)
|
|
||||||
|
|
||||||
{ ngx_string("worker_threads"),
|
|
||||||
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
|
|
||||||
ngx_conf_set_num_slot,
|
|
||||||
0,
|
|
||||||
offsetof(ngx_core_conf_t, worker_threads),
|
|
||||||
NULL },
|
|
||||||
|
|
||||||
{ ngx_string("thread_stack_size"),
|
|
||||||
NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1,
|
|
||||||
ngx_conf_set_size_slot,
|
|
||||||
0,
|
|
||||||
offsetof(ngx_core_conf_t, thread_stack_size),
|
|
||||||
NULL },
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ngx_null_command
|
ngx_null_command
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -971,11 +953,6 @@ ngx_core_module_create_conf(ngx_cycle_t *cycle)
|
|||||||
ccf->user = (ngx_uid_t) NGX_CONF_UNSET_UINT;
|
ccf->user = (ngx_uid_t) NGX_CONF_UNSET_UINT;
|
||||||
ccf->group = (ngx_gid_t) NGX_CONF_UNSET_UINT;
|
ccf->group = (ngx_gid_t) NGX_CONF_UNSET_UINT;
|
||||||
|
|
||||||
#if (NGX_OLD_THREADS)
|
|
||||||
ccf->worker_threads = NGX_CONF_UNSET;
|
|
||||||
ccf->thread_stack_size = NGX_CONF_UNSET_SIZE;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (ngx_array_init(&ccf->env, cycle->pool, 1, sizeof(ngx_str_t))
|
if (ngx_array_init(&ccf->env, cycle->pool, 1, sizeof(ngx_str_t))
|
||||||
!= NGX_OK)
|
!= NGX_OK)
|
||||||
{
|
{
|
||||||
@ -1010,14 +987,6 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf)
|
|||||||
"using last mask for remaining worker processes");
|
"using last mask for remaining worker processes");
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if (NGX_OLD_THREADS)
|
|
||||||
|
|
||||||
ngx_conf_init_value(ccf->worker_threads, 0);
|
|
||||||
ngx_threads_n = ccf->worker_threads;
|
|
||||||
ngx_conf_init_size_value(ccf->thread_stack_size, 2 * 1024 * 1024);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -103,12 +103,6 @@ typedef struct {
|
|||||||
|
|
||||||
ngx_array_t env;
|
ngx_array_t env;
|
||||||
char **environment;
|
char **environment;
|
||||||
|
|
||||||
#if (NGX_OLD_THREADS)
|
|
||||||
ngx_int_t worker_threads;
|
|
||||||
size_t thread_stack_size;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
} ngx_core_conf_t;
|
} ngx_core_conf_t;
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
#include <nginx.h>
|
#include <nginx.h>
|
||||||
|
|
||||||
|
|
||||||
static void ngx_process_init(ngx_cycle_t *cycle);
|
|
||||||
static void ngx_console_init(ngx_cycle_t *cycle);
|
static void ngx_console_init(ngx_cycle_t *cycle);
|
||||||
static int __stdcall ngx_console_handler(u_long type);
|
static int __stdcall ngx_console_handler(u_long type);
|
||||||
static ngx_int_t ngx_create_signal_events(ngx_cycle_t *cycle);
|
static ngx_int_t ngx_create_signal_events(ngx_cycle_t *cycle);
|
||||||
@ -69,8 +68,6 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
|
|||||||
ngx_uint_t live;
|
ngx_uint_t live;
|
||||||
HANDLE events[MAXIMUM_WAIT_OBJECTS];
|
HANDLE events[MAXIMUM_WAIT_OBJECTS];
|
||||||
|
|
||||||
ngx_process_init(cycle);
|
|
||||||
|
|
||||||
ngx_sprintf((u_char *) ngx_master_process_event_name,
|
ngx_sprintf((u_char *) ngx_master_process_event_name,
|
||||||
"ngx_master_%s%Z", ngx_unique);
|
"ngx_master_%s%Z", ngx_unique);
|
||||||
|
|
||||||
@ -250,22 +247,6 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void
|
|
||||||
ngx_process_init(ngx_cycle_t *cycle)
|
|
||||||
{
|
|
||||||
ngx_core_conf_t *ccf;
|
|
||||||
|
|
||||||
ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
|
|
||||||
|
|
||||||
if (ngx_init_threads(ngx_threads_n, ccf->thread_stack_size, cycle)
|
|
||||||
!= NGX_OK)
|
|
||||||
{
|
|
||||||
/* fatal */
|
|
||||||
exit(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ngx_console_init(ngx_cycle_t *cycle)
|
ngx_console_init(ngx_cycle_t *cycle)
|
||||||
{
|
{
|
||||||
@ -1016,8 +997,6 @@ ngx_single_process_cycle(ngx_cycle_t *cycle)
|
|||||||
{
|
{
|
||||||
ngx_tid_t tid;
|
ngx_tid_t tid;
|
||||||
|
|
||||||
ngx_process_init(cycle);
|
|
||||||
|
|
||||||
ngx_console_init(cycle);
|
ngx_console_init(cycle);
|
||||||
|
|
||||||
if (ngx_create_signal_events(cycle) != NGX_OK) {
|
if (ngx_create_signal_events(cycle) != NGX_OK) {
|
||||||
|
@ -9,12 +9,6 @@
|
|||||||
#include <ngx_core.h>
|
#include <ngx_core.h>
|
||||||
|
|
||||||
|
|
||||||
ngx_int_t ngx_threads_n;
|
|
||||||
|
|
||||||
|
|
||||||
static size_t stack_size;
|
|
||||||
|
|
||||||
|
|
||||||
ngx_err_t
|
ngx_err_t
|
||||||
ngx_create_thread(ngx_tid_t *tid,
|
ngx_create_thread(ngx_tid_t *tid,
|
||||||
ngx_thread_value_t (__stdcall *func)(void *arg), void *arg, ngx_log_t *log)
|
ngx_thread_value_t (__stdcall *func)(void *arg), void *arg, ngx_log_t *log)
|
||||||
@ -22,7 +16,7 @@ ngx_create_thread(ngx_tid_t *tid,
|
|||||||
u_long id;
|
u_long id;
|
||||||
ngx_err_t err;
|
ngx_err_t err;
|
||||||
|
|
||||||
*tid = CreateThread(NULL, stack_size, func, arg, 0, &id);
|
*tid = CreateThread(NULL, 0, func, arg, 0, &id);
|
||||||
|
|
||||||
if (*tid != NULL) {
|
if (*tid != NULL) {
|
||||||
ngx_log_error(NGX_LOG_NOTICE, log, 0,
|
ngx_log_error(NGX_LOG_NOTICE, log, 0,
|
||||||
@ -34,12 +28,3 @@ ngx_create_thread(ngx_tid_t *tid,
|
|||||||
ngx_log_error(NGX_LOG_ALERT, log, err, "CreateThread() failed");
|
ngx_log_error(NGX_LOG_ALERT, log, err, "CreateThread() failed");
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ngx_int_t
|
|
||||||
ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle)
|
|
||||||
{
|
|
||||||
stack_size = size;
|
|
||||||
|
|
||||||
return NGX_OK;
|
|
||||||
}
|
|
||||||
|
@ -19,13 +19,9 @@ typedef DWORD ngx_thread_value_t;
|
|||||||
|
|
||||||
ngx_err_t ngx_create_thread(ngx_tid_t *tid,
|
ngx_err_t ngx_create_thread(ngx_tid_t *tid,
|
||||||
ngx_thread_value_t (__stdcall *func)(void *arg), void *arg, ngx_log_t *log);
|
ngx_thread_value_t (__stdcall *func)(void *arg), void *arg, ngx_log_t *log);
|
||||||
ngx_int_t ngx_init_threads(int n, size_t size, ngx_cycle_t *cycle);
|
|
||||||
|
|
||||||
#define ngx_log_tid GetCurrentThreadId()
|
#define ngx_log_tid GetCurrentThreadId()
|
||||||
#define NGX_TID_T_FMT "%ud"
|
#define NGX_TID_T_FMT "%ud"
|
||||||
|
|
||||||
|
|
||||||
extern ngx_int_t ngx_threads_n;
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* _NGX_THREAD_H_INCLUDED_ */
|
#endif /* _NGX_THREAD_H_INCLUDED_ */
|
||||||
|
Loading…
Reference in New Issue
Block a user