Bug 1123394 - Stop spurious re-entry of shell interrupt callback r=shu

This commit is contained in:
Jon Coppeard 2015-01-21 10:53:32 +00:00
Родитель fb018eecf1
Коммит 1b718aa75f
1 изменённых файлов: 6 добавлений и 4 удалений

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

@ -357,6 +357,12 @@ ShellInterruptCallback(JSContext *cx)
if (!gServiceInterrupt)
return true;
// Reset gServiceInterrupt. CancelExecution or InterruptIf will set it to
// true to distinguish watchdog or user triggered interrupts.
// Do this first to prevent other interrupts that may occur while the
// user-supplied callback is executing from re-entering the handler.
gServiceInterrupt = false;
bool result;
RootedValue interruptFunc(cx, *gInterruptFunc);
if (!interruptFunc.isNull()) {
@ -379,10 +385,6 @@ ShellInterruptCallback(JSContext *cx)
if (!result && gExitCode == 0)
gExitCode = EXITCODE_TIMEOUT;
// Reset gServiceInterrupt. CancelExecution or InterruptIf will set it to
// true to distinguish watchdog or user triggered interrupts.
gServiceInterrupt = false;
return result;
}