From 9bcdddda73e88be82b639fc7f5aacf9a4f0928b1 Mon Sep 17 00:00:00 2001 From: Florian Schmaus <flow@cs.fau.de> Date: Sun, 13 Dec 2020 10:29:42 +0100 Subject: [PATCH] [UnboundedBlockingMpscQueue] Improve readability, do not call load() There is no need to call load() on std::atomic if the default memory order is used. --- emper/UnboundedBlockingMpscQueue.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emper/UnboundedBlockingMpscQueue.hpp b/emper/UnboundedBlockingMpscQueue.hpp index 6cdff408..5b2c8534 100644 --- a/emper/UnboundedBlockingMpscQueue.hpp +++ b/emper/UnboundedBlockingMpscQueue.hpp @@ -54,7 +54,7 @@ class UnboundedBlockingMpscQueue : public Blockable<LogSubsystem::U_B_MPSC_Q> { // Micro optimization, see if there is a blocked context // before performing the atomic exchange operation. - if (blockedContext.load() != nullptr) { + if (blockedContext != nullptr) { tryToWakeupBlockedContext<callerEnvironment>(); } } -- GitLab