Skip to content

Commit

Permalink
fixing pump_coro_t flushing incorrectness
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Hesse committed Aug 18, 2015
1 parent 46ef651 commit 87ec495
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/concurrency/pump_coro.cc
Expand Up @@ -95,7 +95,7 @@ void pump_coro_t::run(auto_drainer_t::lock_t keepalive) {

acq.reset(&mutex);
for (auto it = flush_waiters.begin();
it != flush_waiters.upper_bound(timestamp);
it != flush_waiters.upper_bound(local_timestamp);
++it) {
it->second->pulse_if_not_already_pulsed();
}
Expand Down
5 changes: 4 additions & 1 deletion src/concurrency/pump_coro.hpp
Expand Up @@ -13,7 +13,10 @@
/* `pump_coro_t` is a class for managing a blocking function that must eventually run
after a certain event occurs; but if the event occurs multiple times in quick succession,
it's OK for the function to only run once. For example, we might want to flush a value to
disk every time it changes. */
disk every time it changes.
Note that this is not tested very well for `max_callbacks` > 1, and you should be very
careful about your assumptions on how flushing works when providing `max_callbacks` > 1.
*/

class pump_coro_t : public home_thread_mixin_debug_only_t{
public:
Expand Down

0 comments on commit 87ec495

Please sign in to comment.