bug in pipe deactivation fixed

This commit is contained in:
Martin Sustrik
2010-08-28 08:44:12 +02:00
parent 035c937ee7
commit 92923cd40b
4 changed files with 10 additions and 11 deletions

View File

@@ -80,11 +80,8 @@ bool zmq::reader_t::check_read ()
return false;
// Check if there's an item in the pipe.
// If not, deactivate the pipe.
if (!pipe->check_read ()) {
terminate ();
if (!pipe->check_read ())
return false;
}
// If the next item in the pipe is message delimiter,
// initiate its termination.
@@ -198,7 +195,8 @@ bool zmq::writer_t::check_write ()
if (terminating)
return false;
if (pipe_full () && (msg_store == NULL || msg_store->full () || extra_msg_flag)) {
if (pipe_full () && (msg_store == NULL || msg_store->full () ||
extra_msg_flag)) {
stalled = true;
return false;
}