@@ -646,7 +646,7 @@ static PHP_METHOD(V8Js, __construct)
646
646
v8::Isolate::Scope isolate_scope ((ctx)->isolate); \
647
647
v8::Context::Scope context_scope ((ctx)->context);
648
648
649
- static void php_v8js_timer_push (long time_limit, long memory_limit, php_v8js_ctx *c)
649
+ static void php_v8js_timer_push (long time_limit, long memory_limit, php_v8js_ctx *c TSRMLS_DC )
650
650
{
651
651
V8JSG (timer_mutex).lock ();
652
652
@@ -667,7 +667,7 @@ static void php_v8js_timer_push(long time_limit, long memory_limit, php_v8js_ctx
667
667
V8JSG (timer_mutex).unlock ();
668
668
}
669
669
670
- static void php_v8js_timer_pop ()
670
+ static void php_v8js_timer_pop (TSRMLS_D )
671
671
{
672
672
V8JSG (timer_mutex).lock ();
673
673
@@ -683,16 +683,16 @@ static void php_v8js_timer_pop()
683
683
V8JSG (timer_mutex).unlock ();
684
684
}
685
685
686
- static void php_v8js_terminate_execution (php_v8js_ctx *c)
686
+ static void php_v8js_terminate_execution (php_v8js_ctx *c TSRMLS_DC )
687
687
{
688
688
// Forcefully terminate the current thread of V8 execution in the isolate
689
689
v8::V8::TerminateExecution (c->isolate );
690
690
691
691
// Remove this timer from the stack
692
- php_v8js_timer_pop ();
692
+ php_v8js_timer_pop (TSRMLS_C );
693
693
}
694
694
695
- static void php_v8js_timer_thread ()
695
+ static void php_v8js_timer_thread (TSRMLS_D )
696
696
{
697
697
while (!V8JSG (timer_stop)) {
698
698
v8::Locker locker;
@@ -709,15 +709,15 @@ static void php_v8js_timer_thread()
709
709
c->isolate ->GetHeapStatistics (&hs);
710
710
711
711
if (timer_ctx->time_limit > 0 && now > timer_ctx->time_point ) {
712
- php_v8js_terminate_execution (c);
712
+ php_v8js_terminate_execution (c TSRMLS_CC );
713
713
714
714
V8JSG (timer_mutex).lock ();
715
715
c->time_limit_hit = true ;
716
716
V8JSG (timer_mutex).unlock ();
717
717
}
718
718
719
719
if (timer_ctx->memory_limit > 0 && hs.used_heap_size () > timer_ctx->memory_limit ) {
720
- php_v8js_terminate_execution (c);
720
+ php_v8js_terminate_execution (c TSRMLS_CC );
721
721
722
722
V8JSG (timer_mutex).lock ();
723
723
c->memory_limit_hit = true ;
@@ -775,10 +775,10 @@ static PHP_METHOD(V8Js, executeString)
775
775
// If timer thread is not running then start it
776
776
if (!V8JSG (timer_thread)) {
777
777
// If not, start timer thread
778
- V8JSG (timer_thread) = new std::thread (php_v8js_timer_thread);
778
+ V8JSG (timer_thread) = new std::thread (php_v8js_timer_thread TSRMLS_CC );
779
779
}
780
780
781
- php_v8js_timer_push (time_limit, memory_limit, c);
781
+ php_v8js_timer_push (time_limit, memory_limit, c TSRMLS_CC );
782
782
}
783
783
784
784
/* Execute script */
@@ -787,7 +787,7 @@ static PHP_METHOD(V8Js, executeString)
787
787
c->in_execution --;
788
788
789
789
if (time_limit > 0 ) {
790
- php_v8js_timer_pop ();
790
+ php_v8js_timer_pop (TSRMLS_C );
791
791
}
792
792
793
793
char exception_string[64 ];
0 commit comments