Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikkel Krautz <mikkel@krautz.dk>2016-05-15 18:54:48 +0300
committerMikkel Krautz <mikkel@krautz.dk>2016-06-24 01:03:12 +0300
commitc8bd94195a9f869a82c7b53569dcd119e982df04 (patch)
tree4648c45c74323331cb4947efe97a2098e7052345 /src/murmur/Messages.cpp
parent80c6e311e2ef32f1ca5f2bb3ffde000bb9c9c243 (diff)
Hold write lock on qrwlVoiceThread when writing to bSelfDeaf, bSelfMute and ssContext.
Diffstat (limited to 'src/murmur/Messages.cpp')
-rw-r--r--src/murmur/Messages.cpp41
1 files changed, 24 insertions, 17 deletions
diff --git a/src/murmur/Messages.cpp b/src/murmur/Messages.cpp
index e25f8d07d..04dfd3b48 100644
--- a/src/murmur/Messages.cpp
+++ b/src/murmur/Messages.cpp
@@ -622,26 +622,33 @@ void Server::msgUserState(ServerUser *uSource, MumbleProto::UserState &msg) {
bBroadcast = true;
}
- if (msg.has_self_deaf()) {
- uSource->bSelfDeaf = msg.self_deaf();
- if (uSource->bSelfDeaf)
- msg.set_self_mute(true);
- bBroadcast = true;
- }
+ // Writing to bSelfMute, bSelfDeaf and ssContext
+ // requires holding a write lock on qrwlVoiceThread.
+ {
+ QWriteLocker wl(&qrwlVoiceThread);
- if (msg.has_self_mute()) {
- uSource->bSelfMute = msg.self_mute();
- if (! uSource->bSelfMute) {
- msg.set_self_deaf(false);
- uSource->bSelfDeaf = false;
+ if (msg.has_self_deaf()) {
+ uSource->bSelfDeaf = msg.self_deaf();
+ if (uSource->bSelfDeaf)
+ msg.set_self_mute(true);
+ bBroadcast = true;
}
- bBroadcast = true;
- }
- if (msg.has_plugin_context()) {
- uSource->ssContext = msg.plugin_context();
- // Make sure to clear this from the packet so we don't broadcast it
- msg.clear_plugin_context();
+ if (msg.has_self_mute()) {
+ uSource->bSelfMute = msg.self_mute();
+ if (! uSource->bSelfMute) {
+ msg.set_self_deaf(false);
+ uSource->bSelfDeaf = false;
+ }
+ bBroadcast = true;
+ }
+
+ if (msg.has_plugin_context()) {
+ uSource->ssContext = msg.plugin_context();
+
+ // Make sure to clear this from the packet so we don't broadcast it
+ msg.clear_plugin_context();
+ }
}
if (msg.has_plugin_identity()) {