Skip to content

Commit 6318913

Browse files
committedNov 11, 2022
we still need to check the return status for timeout
1 parent 196ef2c commit 6318913

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed
 

‎lib/scheduler.cc

+4-3
Original file line numberDiff line numberDiff line change
@@ -297,13 +297,14 @@ void Scheduler::next() { // NOLINT
297297
// point, then wait until the next tag or until a new event is
298298
// inserted asynchronously into the queue
299299
if (physical_time < t_next.time_point()) {
300-
cv_schedule_.wait_until(lock, t_next.time_point());
301-
// Start over if an earlier event was inserted into the event queue by a physical action
302-
if (t_next != event_queue_.begin()->first) {
300+
auto status = cv_schedule_.wait_until(lock, t_next.time_point());
301+
// Start over if an event was inserted into the event queue by a physical action
302+
if (status == std::cv_status::no_timeout || t_next != event_queue_.begin()->first) {
303303
continue;
304304
}
305305
// update physical time and continue otherwise
306306
physical_time = t_next.time_point();
307+
reactor_assert(t_next == event_queue_.begin()->first);
307308
}
308309
}
309310

0 commit comments

Comments
 (0)
Please sign in to comment.