summaryrefslogtreecommitdiff
path: root/src/node_watchdog.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2016-06-22 23:32:24 +0200
committerAnna Henningsen <anna@addaleax.net>2016-06-25 05:50:26 +0200
commit61196dedad873af15adb078b03153aa02dc3463a (patch)
tree064f31d8f3113134c5b6f0b7ae88a44639c5ac07 /src/node_watchdog.h
parentefc31503b39afc27c878abbeca15819ace20a663 (diff)
downloadandroid-node-v8-61196dedad873af15adb078b03153aa02dc3463a.tar.gz
android-node-v8-61196dedad873af15adb078b03153aa02dc3463a.tar.bz2
android-node-v8-61196dedad873af15adb078b03153aa02dc3463a.zip
vm: test for abort condition of current invocation
When a vm script aborted after a timeout/signal interruption, test whether the local timeout/signal watchdog was responsible for terminating the execution. Without this, when a shorter timer from an outer `vm.run*` invocation fires before an inner timeout, the inner timeout would throw an error instead of the outer one, but because it did not witness the timeout itself, it would assume the termination was the result of a signal interruption. PR-URL: https://github.com/nodejs/node/pull/7373 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'src/node_watchdog.h')
-rw-r--r--src/node_watchdog.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/node_watchdog.h b/src/node_watchdog.h
index 65815e2bcd..77c2d53534 100644
--- a/src/node_watchdog.h
+++ b/src/node_watchdog.h
@@ -46,11 +46,13 @@ class SigintWatchdog {
void Dispose();
v8::Isolate* isolate() { return isolate_; }
+ bool HasReceivedSignal() { return received_signal_; }
void HandleSigint();
private:
void Destroy();
v8::Isolate* isolate_;
+ bool received_signal_;
bool destroyed_;
};