File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -254,18 +254,19 @@ void Scheduler::next() { // NOLINT
254254 {
255255 std::unique_lock<std::mutex> lock{scheduling_mutex_};
256256
257- // shutdown if there are no more events in the queue
258- if (event_queue_.empty () && !stop_) {
259- if (environment_->run_forever ()) {
260- // wait for a new asynchronous event
261- cv_schedule_.wait (lock, [this ]() { return !event_queue_.empty () || stop_; });
262- } else {
263- log_.debug () << " No more events in queue_. -> Terminate!" ;
264- environment_->sync_shutdown ();
257+ while (triggered_actions_ == nullptr || triggered_actions_->empty ()) {
258+
259+ // shutdown if there are no more events in the queue
260+ if (event_queue_.empty () && !stop_) {
261+ if (environment_->run_forever ()) {
262+ // wait for a new asynchronous event
263+ cv_schedule_.wait (lock, [this ]() { return !event_queue_.empty () || stop_; });
264+ } else {
265+ log_.debug () << " No more events in queue_. -> Terminate!" ;
266+ environment_->sync_shutdown ();
267+ }
265268 }
266- }
267269
268- while (triggered_actions_ == nullptr || triggered_actions_->empty ()) {
269270 if (triggered_actions_ != nullptr ) {
270271 action_list_pool_.emplace_back (std::move (triggered_actions_));
271272 }
You can’t perform that action at this time.
0 commit comments