diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 30787cdc2689..80b93612485c 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -4002,8 +4002,6 @@ static bool ShellBuildId(JS::BuildIdCharVector* buildId); static void WorkerMain(WorkerInput* input) { MOZ_ASSERT(input->parentRuntime); - auto mutexShutdown = mozilla::MakeScopeExit([] { Mutex::ShutDown(); }); - JSContext* cx = JS_NewContext(8L * 1024L * 1024L, 2L * 1024L * 1024L, input->parentRuntime); if (!cx) { @@ -4303,8 +4301,6 @@ static void WatchdogMain(JSContext* cx) { } } } - - Mutex::ShutDown(); } static bool ScheduleWatchdog(JSContext* cx, double t) { @@ -7129,8 +7125,6 @@ struct BufferStreamState { static ExclusiveWaitableData* bufferStreamState; static void BufferStreamMain(BufferStreamJob* job) { - auto mutexShutdown = MakeScopeExit([] { Mutex::ShutDown(); }); - const uint8_t* bytes; size_t byteLength; JS::OptimizedEncodingListener* listener; diff --git a/js/src/threading/Mutex.cpp b/js/src/threading/Mutex.cpp index cc4dcc1a6a80..c762dd359001 100644 --- a/js/src/threading/Mutex.cpp +++ b/js/src/threading/Mutex.cpp @@ -17,9 +17,6 @@ MOZ_THREAD_LOCAL(js::Mutex*) js::Mutex::HeldMutexStack; /* static */ bool js::Mutex::Init() { return HeldMutexStack.init(); } -/* static */ -void js::Mutex::ShutDown() { MOZ_ASSERT(HeldMutexStack.get() == nullptr); } - void js::Mutex::lock() { preLockChecks(); impl_.lock(); diff --git a/js/src/threading/Mutex.h b/js/src/threading/Mutex.h index 82ff21bd597c..c47660621cdb 100644 --- a/js/src/threading/Mutex.h +++ b/js/src/threading/Mutex.h @@ -51,10 +51,8 @@ class Mutex { public: #ifdef DEBUG static bool Init(); - static void ShutDown(); #else static bool Init() { return true; } - static void ShutDown() {} #endif explicit Mutex(const MutexId& id) diff --git a/js/src/vm/HelperThreads.cpp b/js/src/vm/HelperThreads.cpp index ebe5ecdc55f2..4807ac1756c8 100644 --- a/js/src/vm/HelperThreads.cpp +++ b/js/src/vm/HelperThreads.cpp @@ -2089,7 +2089,6 @@ void HelperThread::ThreadMain(void* arg) { mozilla::recordreplay::AutoDisallowThreadEvents d; static_cast(arg)->threadLoop(); - Mutex::ShutDown(); } void HelperThread::handleWasmTier1Workload(AutoLockHelperThreadState& locked) { diff --git a/js/src/vm/Initialization.cpp b/js/src/vm/Initialization.cpp index 7b1fa9679288..0e9c783ff8ae 100644 --- a/js/src/vm/Initialization.cpp +++ b/js/src/vm/Initialization.cpp @@ -223,8 +223,6 @@ JS_PUBLIC_API void JS_ShutDown(void) { js::wasm::ShutDown(); - js::Mutex::ShutDown(); - // The only difficult-to-address reason for the restriction that you can't // call JS_Init/stuff/JS_ShutDown multiple times is the Windows PRMJ // NowInit initialization code, which uses PR_CallOnce to initialize the