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/socket_base.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/socket_base.hpp') diff --git a/src/socket_base.hpp b/src/socket_base.hpp index 057f8b1..a74b7d0 100644 --- a/src/socket_base.hpp +++ b/src/socket_base.hpp @@ -42,6 +42,8 @@ namespace zmq public own_t, public array_item_t { + friend class reaper_t; + public: // Create a socket of a specified type. @@ -82,9 +84,9 @@ namespace zmq void activated (class writer_t *pipe_); void terminated (class writer_t *pipe_); - // This function should be called only on zombie sockets. It tries - // to deallocate the zombie. Returns true is object is destroyed. - bool dezombify (); + // This function should be called only on sockets that are already + // closed -- from the reaper thread. It tries to finalise the socket. + bool reap (); protected: -- cgit v1.2.3