From 12f70911128305525fcf8dc627f2d858a64f81f1 Mon Sep 17 00:00:00 2001 From: Paul T Date: Fri, 29 Sep 2023 15:02:38 -0400 Subject: [PATCH] fix: memory ordering --- include/thread_pool/work_stealing_deque.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/thread_pool/work_stealing_deque.h b/include/thread_pool/work_stealing_deque.h index 44ffaa1..e3d9ab9 100644 --- a/include/thread_pool/work_stealing_deque.h +++ b/include/thread_pool/work_stealing_deque.h @@ -178,7 +178,7 @@ namespace dp { if (top < bottom) { // non-empty queue - auto buffer = buffer_.load(release); + auto buffer = buffer_.load(acquire); auto temp = buffer->load(top, acquire); if (!top_.compare_exchange_strong(top, top + 1, seq_cst, relaxed)) { // failed the race