Bug 1313764 - Unlock mutex before calling JS_ReportErrorNumberASCII in js::FutexRuntime::wait. r=lth
authorTooru Fujisawa <arai_a@mac.com>
Mon, 31 Oct 2016 00:59:13 +0900
changeset 320218 a44d3d73a9903bc9e9a565fd7b96da30fecd782d
parent 320217 192f2eb705fdbaf0217cd2dfce18cc5318d3f776
child 320219 708de5d681d113649e8fac2a10a4a0c0eae8be43
push id20754
push usercbook@mozilla.com
push dateMon, 31 Oct 2016 15:58:35 +0000
treeherderfx-team@b1b66b1780c2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1313764
milestone52.0a1
Bug 1313764 - Unlock mutex before calling JS_ReportErrorNumberASCII in js::FutexRuntime::wait. r=lth
js/src/builtin/AtomicsObject.cpp
--- a/js/src/builtin/AtomicsObject.cpp
+++ b/js/src/builtin/AtomicsObject.cpp
@@ -961,16 +961,17 @@ js::FutexRuntime::wait(JSContext* cx, js
     MOZ_ASSERT(&cx->runtime()->fx == this);
     MOZ_ASSERT(cx->runtime()->fx.canWait());
     MOZ_ASSERT(state_ == Idle || state_ == WaitingInterrupted);
 
     // Disallow waiting when a runtime is processing an interrupt.
     // See explanation below.
 
     if (state_ == WaitingInterrupted) {
+        UnlockGuard<Mutex> unlock(locked);
         JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_ATOMICS_WAIT_NOT_ALLOWED);
         return false;
     }
 
     const bool isTimed = timeout.isSome();
 
     auto finalEnd = timeout.map([](mozilla::TimeDuration& timeout) {
         return mozilla::TimeStamp::Now() + timeout;