diff --git a/toolkit/recordreplay/Lock.cpp b/toolkit/recordreplay/Lock.cpp index 148b06289733..32bc86fe117b 100644 --- a/toolkit/recordreplay/Lock.cpp +++ b/toolkit/recordreplay/Lock.cpp @@ -129,7 +129,8 @@ Lock::Find(void* aNativeLock) { MOZ_RELEASE_ASSERT(IsRecordingOrReplaying()); - AutoReadSpinLock ex(gLocksLock); + Maybe ex; + ex.emplace(gLocksLock); if (gLocks) { LockMap::iterator iter = gLocks->find(aNativeLock); @@ -147,6 +148,7 @@ Lock::Find(void* aNativeLock) // held by idling threads that have not diverged from the recording. // This will cause the process to deadlock, so rewind instead. if (lock->mOwner && Thread::GetById(lock->mOwner)->IsIdle()) { + ex.reset(); EnsureNotDivergedFromRecording(); Unreachable(); }