summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-03-31 10:15:37 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2016-03-31 21:15:44 +0200
commitb3ed57f43d0fc18de5ac2610eabc5a97d9eea4a8 (patch)
treee2d1bfb0ba3fcf6eb1e49fbc98f58da291de0ce2
parentafa2b578d6debc42bd4429b6efce8868b8f8fa81 (diff)
Added thread-safety to implicit cpy/mv assign op for synced group settings
-rw-r--r--src/syncedsettings.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/syncedsettings.h b/src/syncedsettings.h
index eb8e66e..e60eb78 100644
--- a/src/syncedsettings.h
+++ b/src/syncedsettings.h
@@ -76,6 +76,7 @@ public:
: mutex{}
, data{}
{
+ std::lock_guard<std::mutex> lock{mutex};
std::lock_guard<std::mutex> lock{other.mutex};
data = other.data;
}
@@ -84,6 +85,7 @@ public:
: mutex{}
, data{}
{
+ std::lock_guard<std::mutex> lock{mutex};
std::lock_guard<std::mutex> lock{other.mutex};
std::swap(data, other.data);
}