Skip to content

Commit 7728449

Browse files
committed
only move the action list back once
1 parent 6c06d5a commit 7728449

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

lib/scheduler.cc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ void Scheduler::next() { // NOLINT
240240
}
241241

242242
triggered_actions_->clear();
243-
action_list_pool_.emplace_back(std::move(triggered_actions_));
244243
}
245244

246245
// cleanup all set ports
@@ -255,6 +254,9 @@ void Scheduler::next() { // NOLINT
255254
std::unique_lock<std::mutex> lock{scheduling_mutex_};
256255

257256
while (triggered_actions_ == nullptr || triggered_actions_->empty()) {
257+
if (triggered_actions_ != nullptr) {
258+
action_list_pool_.emplace_back(std::move(triggered_actions_));
259+
}
258260

259261
// shutdown if there are no more events in the queue
260262
if (event_queue_.empty() && !stop_) {
@@ -267,10 +269,6 @@ void Scheduler::next() { // NOLINT
267269
}
268270
}
269271

270-
if (triggered_actions_ != nullptr) {
271-
action_list_pool_.emplace_back(std::move(triggered_actions_));
272-
}
273-
274272
if (stop_) {
275273
continue_execution_ = false;
276274
log_.debug() << "Shutting down the scheduler";

0 commit comments

Comments
 (0)