From 80ac398bba928fa7f245d2e107071677a13185cf Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Wed, 9 Feb 2011 15:32:15 +0100 Subject: 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 --- src/command.hpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/command.hpp') 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; }; -- cgit v1.2.3