bug 1321884 - clean up the HeldMutexStack on helper threads r=jonco
authorTrevor Saunders <tbsaunde@tbsaunde.org>
Fri, 02 Dec 2016 15:57:37 -0500
changeset 325466 8ec6d1a356d132809281b8bd227abbfcc3318904
parent 325465 7849f81b44de6f6b1a83545bdd514f0a73f21c5e
child 325467 6106512db4baa60f3ef5909d22a661b2228e8052
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersjonco
bugs1321884
milestone53.0a1
bug 1321884 - clean up the HeldMutexStack on helper threads r=jonco The HeldMutexStack is cleaned up in JS_ShutDown() on the main thread, but since it is thread local we need to clean it up on other threads where it is used.
js/src/vm/HelperThreads.cpp
--- a/js/src/vm/HelperThreads.cpp
+++ b/js/src/vm/HelperThreads.cpp
@@ -1402,16 +1402,17 @@ HelperThread::ThreadMain(void* arg)
 
     //See bug 1104658.
     //Set the FPU control word to be the same as the main thread's, or math
     //computations on this thread may use incorrect precision rules during
     //Ion compilation.
     FIX_FPU();
 
     static_cast<HelperThread*>(arg)->threadLoop();
+    Mutex::ShutDown();
 }
 
 void
 HelperThread::handleWasmWorkload(AutoLockHelperThreadState& locked)
 {
     MOZ_ASSERT(HelperThreadState().canStartWasmCompile(locked));
     MOZ_ASSERT(idle());