From a956a5d4fa528b385f9151f9cae6d9979ffb2848 Mon Sep 17 00:00:00 2001 From: Mikkel Schubert <2411627+MikkelSchubert@users.noreply.github.com> Date: Mon, 15 Jul 2024 18:42:26 +0200 Subject: [PATCH] slightly improve wakeup logic --- src/scheduler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 45c796db..d6b60764 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -290,7 +290,9 @@ scheduler::run_io_loop() m_tasks--; // Queue additional read tasks - m_condition_calc.notify_one(); + if (!m_queue_calc.empty() || m_tasks < m_tasks_max) { + m_condition_calc.notify_one(); + } } m_condition_io.notify_all();