Skip to content

Commit f1358c1

Browse files
committed
Problem: duplicate code for hwm check
1 parent dd6bb9a commit f1358c1

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Christian Gudrian
3535
Christian Kamm
3636
Chuck Remes
3737
Conrad D. Steenberg
38+
Constantin Rack
3839
Dhammika Pathirana
3940
Dhruva Krishnamurthy
4041
Dirk O. Kaar

src/pipe.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ bool zmq::pipe_t::check_write ()
206206
if (unlikely (!out_active || state != active))
207207
return false;
208208

209-
bool full = hwm > 0 && msgs_written - peers_msgs_read == uint64_t (hwm);
209+
bool full = !check_hwm();
210210

211211
if (unlikely (full)) {
212212
out_active = false;

src/pipe.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ namespace zmq
121121
// in the peer.
122122
void hiccup ();
123123

124-
// Ensure the pipe wont block on receiving pipe_term.
124+
// Ensure the pipe won't block on receiving pipe_term.
125125
void set_nodelay ();
126126

127127
// Ask pipe to terminate. The termination will happen asynchronously
@@ -130,13 +130,13 @@ namespace zmq
130130
// before actual shutdown.
131131
void terminate (bool delay_);
132132

133-
// set the high water marks.
133+
// Set the high water marks.
134134
void set_hwms (int inhwm_, int outhwm_);
135135

136-
// set the boost to high water marks, used by inproc sockets so total hwm are sum of connect and bind sockets watermarks
136+
// Set the boost to high water marks, used by inproc sockets so total hwm are sum of connect and bind sockets watermarks
137137
void set_hwms_boost(int inhwmboost_, int outhwmboost_);
138138

139-
// check HWM
139+
// Returns true if HWM is not reached
140140
bool check_hwm () const;
141141
private:
142142

0 commit comments

Comments
 (0)