Klaus Demo nginx / 8a9f761
add "Global\" prefix for signal events Igor Sysoev 11 years ago
1 changed file(s) with 12 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
1212 static void ngx_process_init(ngx_cycle_t *cycle);
1313 static void ngx_console_init(ngx_cycle_t *cycle);
1414 static int __stdcall ngx_console_handler(u_long type);
15 static ngx_int_t ngx_create_events(ngx_cycle_t *cycle);
15 static ngx_int_t ngx_create_signal_events(ngx_cycle_t *cycle);
1616 static ngx_int_t ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t type);
1717 static void ngx_reopen_worker_processes(ngx_cycle_t *cycle);
1818 static void ngx_quit_worker_processes(ngx_cycle_t *cycle, ngx_uint_t old);
9393 exit(2);
9494 }
9595
96 if (ngx_create_events(cycle) != NGX_OK) {
96 if (ngx_create_signal_events(cycle) != NGX_OK) {
9797 exit(2);
9898 }
9999
340340
341341
342342 static ngx_int_t
343 ngx_create_events(ngx_cycle_t *cycle)
344 {
345 ngx_sprintf((u_char *) ngx_stop_event_name, "ngx_stop_%s%Z", ngx_unique);
343 ngx_create_signal_events(ngx_cycle_t *cycle)
344 {
345 ngx_sprintf((u_char *) ngx_stop_event_name,
346 "Global\\ngx_stop_%s%Z", ngx_unique);
346347
347348 ngx_stop_event = CreateEvent(NULL, 1, 0, ngx_stop_event_name);
348349 if (ngx_stop_event == NULL) {
352353 }
353354
354355
355 ngx_sprintf((u_char *) ngx_quit_event_name, "ngx_quit_%s%Z", ngx_unique);
356 ngx_sprintf((u_char *) ngx_quit_event_name,
357 "Global\\ngx_quit_%s%Z", ngx_unique);
356358
357359 ngx_quit_event = CreateEvent(NULL, 1, 0, ngx_quit_event_name);
358360 if (ngx_quit_event == NULL) {
363365
364366
365367 ngx_sprintf((u_char *) ngx_reopen_event_name,
366 "ngx_reopen_%s%Z", ngx_unique);
368 "Global\\ngx_reopen_%s%Z", ngx_unique);
367369
368370 ngx_reopen_event = CreateEvent(NULL, 1, 0, ngx_reopen_event_name);
369371 if (ngx_reopen_event == NULL) {
374376
375377
376378 ngx_sprintf((u_char *) ngx_reload_event_name,
377 "ngx_reload_%s%Z", ngx_unique);
379 "Global\\ngx_reload_%s%Z", ngx_unique);
378380
379381 ngx_reload_event = CreateEvent(NULL, 1, 0, ngx_reload_event_name);
380382 if (ngx_reload_event == NULL) {
10341036
10351037 ngx_console_init(cycle);
10361038
1037 if (ngx_create_events(cycle) != NGX_OK) {
1039 if (ngx_create_signal_events(cycle) != NGX_OK) {
10381040 exit(2);
10391041 }
10401042
10551057 ngx_int_t rc;
10561058 char evn[NGX_PROCESS_SYNC_NAME];
10571059
1058 ngx_sprintf((u_char *) evn, "ngx_%s_%ul%Z", sig, pid);
1060 ngx_sprintf((u_char *) evn, "Global\\ngx_%s_%ul%Z", sig, pid);
10591061
10601062 ev = OpenEvent(EVENT_MODIFY_STATE, 0, evn);
10611063 if (ev == NULL) {