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

This commit is contained in:
David Mandelin 2011-01-06 11:30:15 -08:00
Родитель a0994d93bf
Коммит d4d0d04635
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -2677,16 +2677,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);
}
};