summaryrefslogtreecommitdiff
path: root/src/isolate.rs
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-09-24 22:46:36 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-09-25 17:02:49 -0400
commitb088b58f7664cbb2fcb1e12f8aa439d377f56d49 (patch)
treea3cd8a4e40e06c55c76d3465b4e11b8b85b88abb /src/isolate.rs
parent4fd2b19f640d19e57511eb142b63e16c879ef6fd (diff)
Add SetGlobalTimeout().
To be used for a timers implementation soon.
Diffstat (limited to 'src/isolate.rs')
-rw-r--r--src/isolate.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/isolate.rs b/src/isolate.rs
index 64bec5ddf..30e90be5c 100644
--- a/src/isolate.rs
+++ b/src/isolate.rs
@@ -16,6 +16,7 @@ use std;
use std::collections::HashMap;
use std::ffi::CStr;
use std::ffi::CString;
+use std::sync::atomic::AtomicIsize;
use std::sync::mpsc;
use std::sync::Arc;
use std::sync::Mutex;
@@ -48,6 +49,7 @@ pub struct Isolate {
// Isolate cannot be passed between threads but IsolateState can. So any state that
// needs to be accessed outside the main V8 thread should be inside IsolateState.
pub struct IsolateState {
+ pub timeout: AtomicIsize,
pub dir: deno_dir::DenoDir,
pub timers: Mutex<HashMap<u32, futures::sync::oneshot::Sender<()>>>,
pub argv: Vec<String>,
@@ -85,6 +87,7 @@ impl Isolate {
rx,
ntasks: 0,
state: Arc::new(IsolateState {
+ timeout: AtomicIsize::new(-1),
dir: deno_dir::DenoDir::new(flags.reload, None).unwrap(),
timers: Mutex::new(HashMap::new()),
argv: argv_rest,