From b62e1c4f6c050063e4d3591a8df97f0b5fa2ba53 Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Tue, 25 Aug 2026 13:03:24 +0200 Subject: [PATCH 1/2] Fix missing enqueue notifications in timed_thread_context. The push_back of the command queue can return false during insertion of a new command. --- include/exec/timed_thread_scheduler.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/timed_thread_scheduler.hpp b/include/exec/timed_thread_scheduler.hpp index b19e5a262..e2516e92e 100644 --- a/include/exec/timed_thread_scheduler.hpp +++ b/include/exec/timed_thread_scheduler.hpp @@ -229,12 +229,12 @@ namespace experimental::execution STDEXEC::__std::memory_order_relaxed); return; } - if (command_queue_.push_back(op)) + command_queue_.push_back(op); { std::scoped_lock lock{ready_mutex_}; ready_ = true; - cv_.notify_one(); } + cv_.notify_one(); n_submissions_in_flight_.fetch_sub(1, STDEXEC::__std::memory_order_relaxed); } From 3fd71424f645510944aeda20d1b78b85686b17b9 Mon Sep 17 00:00:00 2001 From: Eric Niebler Date: Fri, 4 Sep 2026 15:15:13 -0700 Subject: [PATCH 2/2] obey @lewissbaker --- include/exec/timed_thread_scheduler.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/exec/timed_thread_scheduler.hpp b/include/exec/timed_thread_scheduler.hpp index e2516e92e..b84f1d8f4 100644 --- a/include/exec/timed_thread_scheduler.hpp +++ b/include/exec/timed_thread_scheduler.hpp @@ -192,7 +192,7 @@ namespace experimental::execution while ( !n_submissions_in_flight_.compare_exchange_weak(expected, context_closed, - STDEXEC::__std::memory_order_relaxed)) + STDEXEC::__std::memory_order_acquire)) { STDEXEC::__spin_loop_pause(); expected = 0; @@ -235,7 +235,7 @@ namespace experimental::execution ready_ = true; } cv_.notify_one(); - n_submissions_in_flight_.fetch_sub(1, STDEXEC::__std::memory_order_relaxed); + n_submissions_in_flight_.fetch_sub(1, STDEXEC::__std::memory_order_release); } void request_stop()