summaryrefslogtreecommitdiff
path: root/src/pipe.cpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2011-03-24 15:43:03 +0100
committerMartin Sustrik <sustrik@250bpm.com>2011-03-24 15:43:03 +0100
commit507718ee1a56e376c06389c513de3868297fec35 (patch)
tree1b007ee25899ed3c6971ae2001bb252f128b2d55 /src/pipe.cpp
parentbd9d7715ebe864d1aa85700d1b55b4f37568a1a4 (diff)
ZMQ_HWM type changed to int
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/pipe.cpp')
-rw-r--r--src/pipe.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/pipe.cpp b/src/pipe.cpp
index f09dea4..2af2dc2 100644
--- a/src/pipe.cpp
+++ b/src/pipe.cpp
@@ -25,8 +25,7 @@
#include "pipe.hpp"
#include "likely.hpp"
-zmq::reader_t::reader_t (object_t *parent_, pipe_t *pipe_,
- uint64_t lwm_) :
+zmq::reader_t::reader_t (object_t *parent_, pipe_t *pipe_, int lwm_) :
object_t (parent_),
active (true),
pipe (pipe_),
@@ -163,7 +162,7 @@ void zmq::reader_t::process_pipe_term_ack ()
}
zmq::writer_t::writer_t (object_t *parent_, pipe_t *pipe_, reader_t *reader_,
- uint64_t hwm_) :
+ int hwm_) :
object_t (parent_),
active (true),
pipe (pipe_),
@@ -288,11 +287,11 @@ void zmq::writer_t::process_pipe_term ()
bool zmq::writer_t::pipe_full ()
{
- return hwm > 0 && msgs_written - msgs_read == hwm;
+ return hwm > 0 && msgs_written - msgs_read == uint64_t (hwm);
}
void zmq::create_pipe (object_t *reader_parent_, object_t *writer_parent_,
- uint64_t hwm_, reader_t **reader_, writer_t **writer_)
+ int hwm_, reader_t **reader_, writer_t **writer_)
{
// First compute the low water mark. Following point should be taken
// into consideration:
@@ -314,7 +313,7 @@ void zmq::create_pipe (object_t *reader_parent_, object_t *writer_parent_,
// That done, we still we have to account for the cases where
// HWM < max_wm_delta thus driving LWM to negative numbers.
// Let's make LWM 1/2 of HWM in such cases.
- uint64_t lwm = (hwm_ > max_wm_delta * 2) ?
+ int lwm = (hwm_ > max_wm_delta * 2) ?
hwm_ - max_wm_delta : (hwm_ + 1) / 2;
// Create all three objects pipe consists of: the pipe per se, reader and