Bug 1892045: Quiet a thread-safety warning by taking a mutex in v4l2 capture r=webrtc-reviewers,pehrsons

Just to make the analyzer happy, no risk here

Differential Revision: https://phabricator.services.mozilla.com/D207758
This commit is contained in:
Randell Jesup 2024-04-17 21:10:58 +00:00
parent 765855a457
commit c9632cd18b

View File

@ -303,7 +303,12 @@ int32_t VideoCaptureModuleV4L2::StartCapture(
// start capture thread;
if (_captureThread.empty()) {
quit_ = false;
{
// Probably can't be accessed from another thread with
// _captureThread empty, but the analyzer doesn't know this
MutexLock lock(&capture_lock_);
quit_ = false;
}
_captureThread = rtc::PlatformThread::SpawnJoinable(
[self = scoped_refptr(this)] {
while (self->CaptureProcess()) {