From 79f2056bc3e3198609b7876da6fe56471b9b156d Mon Sep 17 00:00:00 2001 From: Stefan Siegl Date: Tue, 28 Apr 2015 00:21:00 +0200 Subject: [PATCH] Properly stop timer thread, closes #138 We need to reset V8JSG(timer_stop) and V8JSG(timer_thread), otherwise subsequent requests fail on multi-request SAPIs. If we don't reset those, a subsequent request will not start a new timer thread (as V8JSG(timer_thread) != NULL), but will try to join the thread (once more) in GSHUTDOWN as V8JSG(timer_thread) still is non-NULL and hence cause program termination. --- v8js.cc | 2 ++ 1 file changed, 2 insertions(+) mode change 100644 => 100755 v8js.cc diff --git a/v8js.cc b/v8js.cc old mode 100644 new mode 100755 index 072cb57..1730fd8 --- a/v8js.cc +++ b/v8js.cc @@ -129,6 +129,8 @@ static PHP_RSHUTDOWN_FUNCTION(v8js) if (V8JSG(timer_thread)) { V8JSG(timer_stop) = true; V8JSG(timer_thread)->join(); + V8JSG(timer_stop) = false; + V8JSG(timer_thread) = NULL; } #if V8JS_DEBUG