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/object.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/object.hpp') diff --git a/src/object.hpp b/src/object.hpp index 0fd6f47..cee82c8 100644 --- a/src/object.hpp +++ b/src/object.hpp @@ -49,6 +49,7 @@ namespace zmq int register_endpoint (const char *addr_, struct endpoint_t &endpoint_); void unregister_endpoints (class socket_base_t *socket_); struct endpoint_t find_endpoint (const char *addr_); + void destroy_socket (class socket_base_t *socket_); // Logs an message. void log (zmq_msg_t *msg_); @@ -56,10 +57,6 @@ namespace zmq // Chooses least loaded I/O thread. class io_thread_t *choose_io_thread (uint64_t affinity_); - // Zombify particular socket. In other words, pass the ownership to - // the context. - void zombify_socket (class socket_base_t *socket_); - // Derived object can use these functions to send commands // to other objects. void send_stop (); @@ -82,6 +79,8 @@ namespace zmq class own_t *object_); void send_term (class own_t *destination_, int linger_); void send_term_ack (class own_t *destination_); + void send_reap (class socket_base_t *socket_); + void send_done (); // These handlers can be overloaded by the derived objects. They are // called when command arrives from another thread. @@ -99,6 +98,7 @@ namespace zmq virtual void process_term_req (class own_t *object_); virtual void process_term (int linger_); virtual void process_term_ack (); + virtual void process_reap (class socket_base_t *socket_); // Special handler called after a command that requires a seqnum // was processed. The implementation should catch up with its counter -- cgit v1.2.3