From e14e5f44680a838735028bd8f6f94008ffc9eefa Mon Sep 17 00:00:00 2001 From: Brave Yao Date: Tue, 26 May 2015 16:29:16 +0800 Subject: [PATCH] Solve TSan warning about unlocking an unlocked mutex. In my previous cl, https://webrtc-codereview.appspot.com/52479004/, there is 'UnLock()' left when we switched to scoped lock, which will cause TSan warning sometimes. =========================================================== WARNING: ThreadSanitizer: unlock of an unlocked mutex (or by a wrong thread) (pid=9981) #0 pthread_mutex_unlock (libjingle_peerconnection_unittest+0x00000046836f) #1 webrtc::CriticalSectionPosix::Leave() webrtc/system_wrappers/source/critical_section_posix.cc:39:10 (libjingle_peerconnection_unittest+0x000000bc368d) #2 ~CriticalSectionScoped webrtc/system_wrappers/interface/critical_section_wrapper.h:46:48 (libjingle_peerconnection_unittest+0x000000a61fcb) #3 webrtc::AudioDeviceLinuxPulse::RecThreadProcess() webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc:3003 (libjingle_peerconnection_unittest+0x000000a61fcb) =========================================================== BUG=3056 TEST=bots R=tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/56439004 Cr-Commit-Position: refs/heads/master@{#9282} --- webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc index 519fb67759..8b0ae6f539 100644 --- a/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc +++ b/webrtc/modules/audio_device/linux/audio_device_pulse_linux.cc @@ -2986,7 +2986,6 @@ bool AudioDeviceLinuxPulse::RecThreadProcess() // Read data and provide it to VoiceEngine if (ReadRecordedData(sampleData, sampleDataSize) == -1) { - UnLock(); return true; } PaLock();