Commit 915284ad authored by Kenton Varda's avatar Kenton Varda

Add notes that UnixEventPort doesn't work after fork().

parent 1859b718
......@@ -477,6 +477,12 @@ AsyncIoContext setupAsyncIo();
// print(text);
// return 0;
// }
//
// WARNING: An AsyncIoContext can only be used in the thread and process that created it. In
// particular, note that after a fork(), an AsyncIoContext created in the parent process will
// not work correctly in the child, even if the parent ceases to use its copy. In particular
// note that this means that server processes which daemonize themselves at startup must wait
// until after daemonization to create an AsyncIoContext.
// =======================================================================================
// inline implementation details
......
......@@ -51,6 +51,12 @@ class UnixEventPort: public EventPort {
// The implementation reserves a signal for internal use. By default, it uses SIGUSR1. If you
// need to use SIGUSR1 for something else, you must offer a different signal by calling
// setReservedSignal() at startup.
//
// WARNING: A UnixEventPort can only be used in the thread and process that created it. In
// particular, note that after a fork(), a UnixEventPort created in the parent process will
// not work correctly in the child, even if the parent ceases to use its copy. In particular
// note that this means that server processes which daemonize themselves at startup must wait
// until after daemonization to create a UnixEventPort.
public:
UnixEventPort();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment