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 <null> (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}
This commit is contained in:
parent
f09e09c7ee
commit
e14e5f4468
@ -2986,7 +2986,6 @@ bool AudioDeviceLinuxPulse::RecThreadProcess()
|
|||||||
// Read data and provide it to VoiceEngine
|
// Read data and provide it to VoiceEngine
|
||||||
if (ReadRecordedData(sampleData, sampleDataSize) == -1)
|
if (ReadRecordedData(sampleData, sampleDataSize) == -1)
|
||||||
{
|
{
|
||||||
UnLock();
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
PaLock();
|
PaLock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user