mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-28 05:10:49 +00:00
Bug 1410132 - Skip mutex ordering checks when JS engine is not initialized r=sfink
This commit is contained in:
parent
0a74c282e1
commit
5f7c71c302
@ -6,6 +6,7 @@
|
||||
|
||||
#include "threading/Mutex.h"
|
||||
|
||||
#include "js/Initialization.h"
|
||||
#include "js/Utility.h"
|
||||
|
||||
using namespace js;
|
||||
@ -44,6 +45,11 @@ js::Mutex::heldMutexStack()
|
||||
void
|
||||
js::Mutex::lock()
|
||||
{
|
||||
if (!JS_IsInitialized()) {
|
||||
MutexImpl::lock();
|
||||
return;
|
||||
}
|
||||
|
||||
auto& stack = heldMutexStack();
|
||||
if (!stack.empty()) {
|
||||
const Mutex& prev = *stack.back();
|
||||
@ -65,6 +71,11 @@ js::Mutex::lock()
|
||||
void
|
||||
js::Mutex::unlock()
|
||||
{
|
||||
if (!JS_IsInitialized()) {
|
||||
MutexImpl::unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
auto& stack = heldMutexStack();
|
||||
MOZ_ASSERT(stack.back() == this);
|
||||
MutexImpl::unlock();
|
||||
|
Loading…
x
Reference in New Issue
Block a user