From 1ecf9bff4f38b9617b07309b644c382b6c52bc9c Mon Sep 17 00:00:00 2001 From: Stephen Seo Date: Sun, 5 Jan 2020 15:12:13 +0900 Subject: [PATCH] Minor refactoring/fix of use of atomic_bool --- src/UDPConnection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/UDPConnection.cpp b/src/UDPConnection.cpp index 3d62434..cf0731a 100644 --- a/src/UDPConnection.cpp +++ b/src/UDPConnection.cpp @@ -288,7 +288,7 @@ void UDPC::Context::update_impl() { { unsigned char *sk = nullptr; unsigned char *pk = nullptr; - if(keysSet.load()) { + if(keysSet.load(std::memory_order_relaxed)) { sk = this->sk; pk = this->pk; } @@ -1206,7 +1206,7 @@ void UDPC::Context::update_impl() { } unsigned char *sk = nullptr; unsigned char *pk = nullptr; - if(keysSet.load()) { + if(keysSet.load(std::memory_order_relaxed)) { sk = this->sk; pk = this->pk; }