Always Signal() the first Cond when changing the maximum
diff mbox

Message ID
State New, archived
Headers show

Commit Message

Loic Dachary Jan. 21, 2013, 1:30 p.m. UTC
Removes a test by which the waiting queue is only
 Signal()ed if the new maximum is lower than the current
 maximum.  There is no evidence of a use case where such a
 restriction would be useful. In addition waking up a thread
 when the maximum increases gives it a chance to immediately
 continue the suspended process instead of waiting for the
 next put().  For additional context see the discussion at

Signed-off-by: Loic Dachary <>
 src/common/ |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff mbox

diff --git a/src/common/ b/src/common/
index 844263a..82ffe7a 100644
--- a/src/common/
+++ b/src/common/
@@ -65,7 +65,7 @@  Throttle::~Throttle()
 void Throttle::_reset_max(int64_t m)
-  if (m < ((int64_t) && !cond.empty())
+  if (!cond.empty())
   logger->set(l_throttle_max, m);