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 320174 a44d3d73a9903bc9e9a565fd7b96da30fecd782d
parent 320173 192f2eb705fdbaf0217cd2dfce18cc5318d3f776
child 320209 708de5d681d113649e8fac2a10a4a0c0eae8be43
push id83329
push userarai_a@mac.com
push dateSun, 30 Oct 2016 16:01:25 +0000
treeherdermozilla-inbound@a44d3d73a990 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1313764
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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;