From 5f267412f6f110a87583b547d27744d8760fc2ef Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Wed, 13 Sep 2023 11:51:36 -0700 Subject: Add some thread safety --- indra/newview/llvoicewebrtc.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra/newview/llvoicewebrtc.h') diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h index 061e00581e..f4e2ac0b7f 100644 --- a/indra/newview/llvoicewebrtc.h +++ b/indra/newview/llvoicewebrtc.h @@ -655,10 +655,13 @@ private: int mVoiceControlState; LLMutex mVoiceStateMutex; - void setVoiceControlState(int new_voice_control_state) + void setVoiceControlStateUnless(int new_voice_control_state, int unless=-1) { LLMutexLock lock(&mVoiceStateMutex); - mVoiceControlState = new_voice_control_state; + if (mVoiceControlState != unless) + { + mVoiceControlState = new_voice_control_state; + } } int getVoiceControlState() { -- cgit v1.2.3