Terminate context in a child process of fork() to replace file descriptors to not interfere with parent process's context

This commit is contained in:
Matt Connolly
2013-08-31 21:17:11 +10:00
parent 0478ee04f4
commit ff2900fd52
10 changed files with 141 additions and 2 deletions

View File

@@ -44,6 +44,13 @@ namespace zmq
void send (const command_t &cmd_);
int recv (command_t *cmd_, int timeout_);
#ifdef HAVE_FORK
// close the file descriptors in the signaller. This is used in a forked
// child process to close the file descriptors so that they do not interfere
// with the context in the parent process.
void forked() { signaler.forked(); }
#endif
private:
// The pipe to store actual commands.