0
0
mirror of https://github.com/phpv8/v8js.git synced 2024-09-19 00:25:18 +00:00

Don't terminate execution repeatedly

This commit is contained in:
Stefan Siegl 2015-09-22 22:36:50 +02:00
parent 790735f04a
commit 5f6d9aee2d

View File

@ -202,6 +202,13 @@ void v8js_v8_call(v8js_ctx *c, zval **return_value,
void v8js_terminate_execution(v8::Isolate *isolate) /* {{{ */
{
if(v8::V8::IsExecutionTerminating(isolate)) {
/* Execution already terminating, needn't trigger it again and
* especially must not execute the spinning loop (which would cause
* crashes in V8 itself, at least with 4.2 and 4.3 version lines). */
return;
}
/* Unfortunately just calling TerminateExecution on the isolate is not
* enough, since v8 just marks the thread as "to be aborted" and doesn't
* immediately do so. Hence we enter an endless loop after signalling