annotate src/misc/ngx_cpp_test_module.cpp @ 3293:8abb88374c6c

Fix a bug introduced in r2032: After a child process has read a terminate message from a channel, the process tries to read the channel again. The kernel (at least FreeBSD) may preempt the process and sends a SIGIO signal to a master process. The master process sends a new terminate message, the kernel switches again to the the child process, and the child process reads the messages instead of an EAGAIN error. And this may repeat over and over. Being that the child process can not exit the cycle and test the termination flag set by the message handler. The fix disallow the master process to send a new terminate message on SIGIO signal reception. It may send the message only on SIGALARM signal.
author Igor Sysoev <igor@sysoev.ru>
date Wed, 04 Nov 2009 19:41:08 +0000
parents 69ef10ad7011
children 4c36e15651f7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2157
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 // stub module to test header files' C++ compatibilty
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
3
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4 extern "C" {
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5 #include <ngx_config.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 #include <ngx_core.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 #include <ngx_event.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 #include <ngx_event_connect.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 #include <ngx_event_pipe.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11 #include <ngx_http.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 #include <ngx_mail.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 #include <ngx_mail_pop3_module.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 #include <ngx_mail_imap_module.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 #include <ngx_mail_smtp_module.h>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 }
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19 // nginx header files should go before other, because they define 64-bit off_t
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20 // #include <string>
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23 void
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 ngx_cpp_test_handler(void *data)
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 {
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26 return;
69ef10ad7011 ngx_cpp_test_module
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
27 }