summaryrefslogtreecommitdiff
path: root/src/ctx.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-04-09 09:35:34 +0200
committerMartin Sustrik <sustrik@250bpm.com>2011-04-09 09:35:34 +0200
commitb96fe15bb666e59728b6aa02f28c5838020f6bf3 (patch)
tree8c01bf7fefd99397643cf5e302ce0179b6748472 /src/ctx.hpp
parente62686aca57ab307e952c53fd3848acaad22735e (diff)
Run-time checking for context & socket validity added
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/ctx.hpp')
-rw-r--r--src/ctx.hpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ctx.hpp b/src/ctx.hpp
index c6ea4ce..33d5dad 100644
--- a/src/ctx.hpp
+++ b/src/ctx.hpp
@@ -60,6 +60,9 @@ namespace zmq
// of I/O thread pool to create.
ctx_t (uint32_t io_threads_);
+ // Returns false if object is not a context.
+ bool check_tag ();
+
// This function is called when user invokes zmq_term. If there are
// no more sockets open it'll cause all the infrastructure to be shut
// down. If there are open sockets still, the deallocation happens
@@ -98,6 +101,9 @@ namespace zmq
~ctx_t ();
+ // Used to check whether the object is a context.
+ uint32_t tag;
+
// Sockets belonging to this context. We need the list so that
// we can notify the sockets when zmq_term() is called. The sockets
// will return ETERM then.