summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDhammika Pathirana <dhammika@gmail.com>2011-01-07 13:28:35 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-01-07 13:28:35 +0100
commitbabdf48aacc585d57457da8dec1fb6ce262bf719 (patch)
treed622b193ce934732034c8968aa61b7eee39ebe26 /src
parent8e0049e2fb60d31c07786fffe39fdc9c63369dfa (diff)
Fix pipe writer termination
Signed-off-by: Dhammika Pathirana <dhammika@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/pipe.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index bbdd44e..6335690 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -275,6 +275,7 @@ void zmq::writer_t::terminate ()
// Prevent double termination.
if (terminating)
return;
+ terminating = true;
// Mark the pipe as not available for writing.
active = false;
@@ -339,7 +340,7 @@ void zmq::writer_t::process_activate_writer (uint64_t msgs_read_)
// If the writer was non-active before, let's make it active
// (available for writing messages to).
- if (!active) {
+ if (!active && !terminating) {
active = true;
zmq_assert (sink);
sink->activated (this);