|
@@ -1559,6 +1559,12 @@ static PHP_METHOD(V8Js, setTimeLimit)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
V8JSG(timer_mutex).unlock();
|
|
V8JSG(timer_mutex).unlock();
|
|
|
|
+
|
|
|
|
+ if (c->in_execution && time_limit && !V8JSG(timer_thread)) {
|
|
|
|
+ /* If timer thread is not started already and we now impose a time limit
|
|
|
|
+ * finally install the timer. */
|
|
|
|
+ V8JSG(timer_thread) = new std::thread(php_v8js_timer_thread TSRMLS_CC);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
/* }}} */
|
|
/* }}} */
|
|
|
|
|
|
@@ -1584,6 +1590,12 @@ static PHP_METHOD(V8Js, setMemoryLimit)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
V8JSG(timer_mutex).unlock();
|
|
V8JSG(timer_mutex).unlock();
|
|
|
|
+
|
|
|
|
+ if (c->in_execution && memory_limit && !V8JSG(timer_thread)) {
|
|
|
|
+ /* If timer thread is not started already and we now impose a memory limit
|
|
|
|
+ * finally install the timer. */
|
|
|
|
+ V8JSG(timer_thread) = new std::thread(php_v8js_timer_thread TSRMLS_CC);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
/* }}} */
|
|
/* }}} */
|
|
|
|
|