summaryrefslogtreecommitdiff
path: root/src/socket_base.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-02-09 15:32:15 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-02-09 15:32:15 +0100
commit80ac398bba928fa7f245d2e107071677a13185cf (patch)
tree57c51a7adb5f4cb1a91396fe0b223538a4d428d7 /src/socket_base.hpp
parent889424e675eecd9d9c7d1121456401d5c43029a5 (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/socket_base.hpp')
-rw-r--r--src/socket_base.hpp8
1 files changed, 5 insertions, 3 deletions
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: