Commits

David Mandelin  committed c55afda

Bug 622691 followup: invert statement order in AutoUnlockDefaultCompartment to get update inside lock, r=gal

  • Participants
  • Parent commits 423d378

Comments (0)

Files changed (1)

File js/src/jscntxt.h

       JSContext *cx;
   public:
     AutoUnlockDefaultCompartment(JSContext *cx) : cx(cx) {
-        JS_UNLOCK(cx, &cx->runtime->atomState.lock);
 #ifdef JS_THREADSAFE
         cx->runtime->defaultCompartmentIsLocked = false;
 #endif
+        JS_UNLOCK(cx, &cx->runtime->atomState.lock);
     }
     ~AutoUnlockDefaultCompartment() {
+        JS_LOCK(cx, &cx->runtime->atomState.lock);
 #ifdef JS_THREADSAFE
         cx->runtime->defaultCompartmentIsLocked = true;
 #endif
-        JS_LOCK(cx, &cx->runtime->atomState.lock);
     }
 };