]> git.seodisparate.com - UDPConnection/commitdiff
Minor refactoring/fix of use of atomic_bool
authorStephen Seo <seo.disparate@gmail.com>
Sun, 5 Jan 2020 06:12:13 +0000 (15:12 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Sun, 5 Jan 2020 06:12:13 +0000 (15:12 +0900)
src/UDPConnection.cpp

index 3d62434888323b842b0ff342812a633c0b997bb6..cf0731ac38d7b71f231cf4c71f6b53f9aee30aff 100644 (file)
@@ -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;
             }