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

This commit is contained in:
David Mandelin 2011-01-06 11:30:15 -08:00
parent acbe1325b9
commit f018264c7f

View File

@ -2678,16 +2678,16 @@ class AutoUnlockDefaultCompartment {
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);
}
};