diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-02-09 15:32:15 +0100 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-02-09 15:32:15 +0100 |
commit | 80ac398bba928fa7f245d2e107071677a13185cf (patch) | |
tree | 57c51a7adb5f4cb1a91396fe0b223538a4d428d7 /src/command.hpp | |
parent | 889424e675eecd9d9c7d1121456401d5c43029a5 (diff) |
Initial implementation of reaper thread.
Reaper thread destroys the socket asynchronously.
zmq_term() can be interrupted by a signal (EINTR).
zmq_socket() will return ETERM after zmq_term() was called.
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/command.hpp')
-rw-r--r-- | src/command.hpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/command.hpp b/src/command.hpp index 31a0e54..ec0850d 100644 --- a/src/command.hpp +++ b/src/command.hpp @@ -45,7 +45,9 @@ namespace zmq pipe_term_ack, term_req, term, - term_ack + term_ack, + reap, + done } type; union { @@ -117,6 +119,17 @@ namespace zmq struct { } term_ack; + // Transfers the ownership of the closed socket + // to the reaper thread. + struct { + class socket_base_t *socket; + } reap; + + // Sent by reaper thread to the term thread when all the sockets + // are successfully deallocated. + struct { + } done; + } args; }; |