summaryrefslogtreecommitdiff
path: root/src/socket_base.cpp
diff options
context:
space:
mode:
authorMartin Lucina <martin@lucina.net>2012-01-23 08:53:57 +0100
committerMartin Lucina <martin@lucina.net>2012-01-23 08:53:57 +0100
commitb593ea30833ad5dcacb9076c988aec31b0cf26ec (patch)
tree3d0c6f1dadfa2d947cf23f6109bb27b01ab202af /src/socket_base.cpp
parentcbaa7cfa93893876e4fd8794b6ea39f4d245b6b5 (diff)
Imported Upstream version 2.1.7upstream/2.1.7
Diffstat (limited to 'src/socket_base.cpp')
-rw-r--r--src/socket_base.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/socket_base.cpp b/src/socket_base.cpp
index 4317bb0..24789b8 100644
--- a/src/socket_base.cpp
+++ b/src/socket_base.cpp
@@ -61,6 +61,11 @@
#include "xpub.hpp"
#include "xsub.hpp"
+bool zmq::socket_base_t::check_tag ()
+{
+ return tag == 0xbaddecaf;
+}
+
zmq::socket_base_t *zmq::socket_base_t::create (int type_, class ctx_t *parent_,
uint32_t tid_)
{
@@ -110,6 +115,7 @@ zmq::socket_base_t *zmq::socket_base_t::create (int type_, class ctx_t *parent_,
zmq::socket_base_t::socket_base_t (ctx_t *parent_, uint32_t tid_) :
own_t (parent_, tid_),
+ tag (0xbaddecaf),
ctx_terminated (false),
destroyed (false),
last_tsc (0),
@@ -126,6 +132,9 @@ zmq::socket_base_t::~socket_base_t ()
sessions_sync.lock ();
zmq_assert (sessions.empty ());
sessions_sync.unlock ();
+
+ // Mark the socket as dead.
+ tag = 0xdeadbeef;
}
zmq::mailbox_t *zmq::socket_base_t::get_mailbox ()