summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Glöckner <cgloeckner@freenet.de>2016-03-31 10:15:37 +0200
committerChristian Glöckner <cgloeckner@freenet.de>2016-03-31 10:15:37 +0200
commit94961f8134c85981df467c70ee65a599f87a0bcb (patch)
tree356d103693213bfbcb361379e23ff37007c9eb4b
parentfb944022b0e727007420d30ff84d28974fb5f38e (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);
}