Skip to content

Commit 35685ed

Browse files
committed
TSRM fixes
1 parent 2520e86 commit 35685ed

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

v8js.cc

+10-10
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ static PHP_METHOD(V8Js, __construct)
646646
v8::Isolate::Scope isolate_scope((ctx)->isolate); \
647647
v8::Context::Scope context_scope((ctx)->context);
648648

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)
650650
{
651651
V8JSG(timer_mutex).lock();
652652

@@ -667,7 +667,7 @@ static void php_v8js_timer_push(long time_limit, long memory_limit, php_v8js_ctx
667667
V8JSG(timer_mutex).unlock();
668668
}
669669

670-
static void php_v8js_timer_pop()
670+
static void php_v8js_timer_pop(TSRMLS_D)
671671
{
672672
V8JSG(timer_mutex).lock();
673673

@@ -683,16 +683,16 @@ static void php_v8js_timer_pop()
683683
V8JSG(timer_mutex).unlock();
684684
}
685685

686-
static void php_v8js_terminate_execution(php_v8js_ctx *c)
686+
static void php_v8js_terminate_execution(php_v8js_ctx *c TSRMLS_DC)
687687
{
688688
// Forcefully terminate the current thread of V8 execution in the isolate
689689
v8::V8::TerminateExecution(c->isolate);
690690

691691
// Remove this timer from the stack
692-
php_v8js_timer_pop();
692+
php_v8js_timer_pop(TSRMLS_C);
693693
}
694694

695-
static void php_v8js_timer_thread()
695+
static void php_v8js_timer_thread(TSRMLS_D)
696696
{
697697
while (!V8JSG(timer_stop)) {
698698
v8::Locker locker;
@@ -709,15 +709,15 @@ static void php_v8js_timer_thread()
709709
c->isolate->GetHeapStatistics(&hs);
710710

711711
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);
713713

714714
V8JSG(timer_mutex).lock();
715715
c->time_limit_hit = true;
716716
V8JSG(timer_mutex).unlock();
717717
}
718718

719719
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);
721721

722722
V8JSG(timer_mutex).lock();
723723
c->memory_limit_hit = true;
@@ -775,10 +775,10 @@ static PHP_METHOD(V8Js, executeString)
775775
// If timer thread is not running then start it
776776
if (!V8JSG(timer_thread)) {
777777
// 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);
779779
}
780780

781-
php_v8js_timer_push(time_limit, memory_limit, c);
781+
php_v8js_timer_push(time_limit, memory_limit, c TSRMLS_CC);
782782
}
783783

784784
/* Execute script */
@@ -787,7 +787,7 @@ static PHP_METHOD(V8Js, executeString)
787787
c->in_execution--;
788788

789789
if (time_limit > 0) {
790-
php_v8js_timer_pop();
790+
php_v8js_timer_pop(TSRMLS_C);
791791
}
792792

793793
char exception_string[64];

0 commit comments

Comments
 (0)