From dd67b2ea4ab6cf256ed530b63ce5ed21a65d8639 Mon Sep 17 00:00:00 2001 From: bruce Date: Wed, 13 Nov 2024 00:25:00 +0800 Subject: [PATCH] mqsize fetch sub use acq rel --- src/moon/core/worker.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/moon/core/worker.cpp b/src/moon/core/worker.cpp index b015a62a..a8b9755d 100644 --- a/src/moon/core/worker.cpp +++ b/src/moon/core/worker.cpp @@ -190,7 +190,7 @@ void worker::send(message&& msg) { service* s = nullptr; for (auto& m: read_queue) { s = handle_one(s, std::move(m)); - --mqsize_; + mqsize_.fetch_sub(1, std::memory_order_acq_rel); } read_queue.clear(); }