Mercurial > hg > nginx
comparison src/core/nginx.c @ 376:d0451e402e27
nginx-0.0.7-2004-07-05-10:55:54 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 05 Jul 2004 06:55:54 +0000 |
parents | e411b1482ee3 |
children | 5659d773cfa8 |
comparison
equal
deleted
inserted
replaced
375:744ccb59062d | 376:d0451e402e27 |
---|---|
32 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, | 32 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, |
33 ngx_conf_set_num_slot, | 33 ngx_conf_set_num_slot, |
34 0, | 34 0, |
35 offsetof(ngx_core_conf_t, worker_processes), | 35 offsetof(ngx_core_conf_t, worker_processes), |
36 NULL }, | 36 NULL }, |
37 | |
38 #if (NGX_THREADS) | |
39 | |
40 { ngx_string("worker_threads"), | |
41 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, | |
42 ngx_conf_set_num_slot, | |
43 0, | |
44 offsetof(ngx_core_conf_t, worker_threads), | |
45 NULL }, | |
46 | |
47 { ngx_string("thread_stack_size"), | |
48 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE1, | |
49 ngx_conf_set_size_slot, | |
50 0, | |
51 offsetof(ngx_core_conf_t, thread_stack_size), | |
52 NULL }, | |
53 | |
54 #endif | |
37 | 55 |
38 { ngx_string("user"), | 56 { ngx_string("user"), |
39 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE12, | 57 NGX_MAIN_CONF|NGX_DIRECT_CONF|NGX_CONF_TAKE12, |
40 ngx_set_user, | 58 ngx_set_user, |
41 0, | 59 0, |
103 ngx_cycle = &init_cycle; | 121 ngx_cycle = &init_cycle; |
104 | 122 |
105 ngx_memzero(&ctx, sizeof(ngx_master_ctx_t)); | 123 ngx_memzero(&ctx, sizeof(ngx_master_ctx_t)); |
106 ctx.argc = argc; | 124 ctx.argc = argc; |
107 ctx.argv = argv; | 125 ctx.argv = argv; |
108 | |
109 #if (NGX_THREADS) | |
110 if (ngx_time_mutex_init(log) == NGX_ERROR) { | |
111 return 1; | |
112 } | |
113 #endif | |
114 | 126 |
115 if (ngx_getopt(&ctx, &init_cycle) == NGX_ERROR) { | 127 if (ngx_getopt(&ctx, &init_cycle) == NGX_ERROR) { |
116 return 1; | 128 return 1; |
117 } | 129 } |
118 | 130 |
339 * ccf->newpid = NULL; | 351 * ccf->newpid = NULL; |
340 */ | 352 */ |
341 ccf->daemon = NGX_CONF_UNSET; | 353 ccf->daemon = NGX_CONF_UNSET; |
342 ccf->master = NGX_CONF_UNSET; | 354 ccf->master = NGX_CONF_UNSET; |
343 ccf->worker_processes = NGX_CONF_UNSET; | 355 ccf->worker_processes = NGX_CONF_UNSET; |
356 #if (NGX_THREADS) | |
357 ccf->worker_threads = NGX_CONF_UNSET; | |
358 ccf->thread_stack_size = NGX_CONF_UNSET; | |
359 #endif | |
344 ccf->user = (ngx_uid_t) NGX_CONF_UNSET; | 360 ccf->user = (ngx_uid_t) NGX_CONF_UNSET; |
345 ccf->group = (ngx_gid_t) NGX_CONF_UNSET; | 361 ccf->group = (ngx_gid_t) NGX_CONF_UNSET; |
346 | 362 |
347 return ccf; | 363 return ccf; |
348 } | 364 } |
353 ngx_core_conf_t *ccf = conf; | 369 ngx_core_conf_t *ccf = conf; |
354 | 370 |
355 ngx_conf_init_value(ccf->daemon, 1); | 371 ngx_conf_init_value(ccf->daemon, 1); |
356 ngx_conf_init_value(ccf->master, 1); | 372 ngx_conf_init_value(ccf->master, 1); |
357 ngx_conf_init_value(ccf->worker_processes, 1); | 373 ngx_conf_init_value(ccf->worker_processes, 1); |
374 | |
375 #if (NGX_THREADS) | |
376 ngx_conf_init_value(ccf->worker_threads, 0); | |
377 ngx_threads_n = ccf->worker_threads; | |
378 ngx_conf_init_size_value(ccf->thread_stack_size, 2 * 1024 * 1024); | |
379 #endif | |
358 | 380 |
359 #if !(WIN32) | 381 #if !(WIN32) |
360 | 382 |
361 /* TODO: default "nobody" user */ | 383 /* TODO: default "nobody" user */ |
362 | 384 |