Fix hang with timers in MultiThreadedExecutor (#835) (#836)

Signed-off-by: Todd Malsbary <todd.malsbary@intel.com>
This commit is contained in:
Todd Malsbary 2019-08-30 10:38:51 -07:00 committed by ivanpauno
parent d5301c1c7c
commit f153cf7173

View file

@ -86,6 +86,11 @@ MultiThreadedExecutor::run(size_t)
if (any_exec.timer) { if (any_exec.timer) {
// Guard against multiple threads getting the same timer. // Guard against multiple threads getting the same timer.
if (scheduled_timers_.count(any_exec.timer) != 0) { if (scheduled_timers_.count(any_exec.timer) != 0) {
// Make sure that any_exec's callback group is reset before
// the lock is released.
if (any_exec.callback_group) {
any_exec.callback_group->can_be_taken_from().store(true);
}
continue; continue;
} }
scheduled_timers_.insert(any_exec.timer); scheduled_timers_.insert(any_exec.timer);