From b46fabb8a7fbf0613bd5a1b8f43315b918161473 Mon Sep 17 00:00:00 2001 From: Lasan Mahaliyana Date: Fri, 6 Feb 2026 23:29:13 +0530 Subject: [PATCH] fixed thread pool memory_order bug --- internal/platform/implementation/linux/thread_pool.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/platform/implementation/linux/thread_pool.cc b/internal/platform/implementation/linux/thread_pool.cc index 7f6ccd6c..0d922a3c 100644 --- a/internal/platform/implementation/linux/thread_pool.cc +++ b/internal/platform/implementation/linux/thread_pool.cc @@ -32,7 +32,7 @@ ThreadPool::ThreadPool(size_t max_pool_size) ThreadPool::~ThreadPool() { ShutDown(); } bool ThreadPool::Start() { - shut_down_.store(false, std::memory_order_acquire); + shut_down_.store(false, std::memory_order_release); auto runner = [this]() { while (true) { @@ -87,7 +87,7 @@ bool ThreadPool::Run(Runnable &&task) { void ThreadPool::ShutDown() { { absl::MutexLock l(&tasks_mutex_); - shut_down_.store(true, std::memory_order_acquire); + shut_down_.store(true, std::memory_order_relaxed); } { absl::ReaderMutexLock l(&threads_mutex_);