summaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.h')
-rw-r--r--src/env.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/env.h b/src/env.h
index 786f0846f4..8f4c5ea1a6 100644
--- a/src/env.h
+++ b/src/env.h
@@ -628,6 +628,9 @@ class Environment {
inline uv_loop_t* event_loop() const;
inline uint32_t watched_providers() const;
+ static inline Environment* from_timer_handle(uv_timer_t* handle);
+ inline uv_timer_t* timer_handle();
+
static inline Environment* from_immediate_check_handle(uv_check_t* handle);
inline uv_check_t* immediate_check_handle();
inline uv_idle_t* immediate_idle_handle();
@@ -840,6 +843,8 @@ class Environment {
static inline Environment* ForAsyncHooks(AsyncHooks* hooks);
v8::Local<v8::Value> GetNow();
+ void ScheduleTimer(int64_t duration);
+ void ToggleTimerRef(bool ref);
inline void AddCleanupHook(void (*fn)(void*), void* arg);
inline void RemoveCleanupHook(void (*fn)(void*), void* arg);
@@ -857,6 +862,7 @@ class Environment {
v8::Isolate* const isolate_;
IsolateData* const isolate_data_;
tracing::Agent* const tracing_agent_;
+ uv_timer_t timer_handle_;
uv_check_t immediate_check_handle_;
uv_idle_t immediate_idle_handle_;
uv_prepare_t idle_prepare_handle_;
@@ -919,6 +925,8 @@ class Environment {
worker::Worker* worker_context_ = nullptr;
+ static void RunTimers(uv_timer_t* handle);
+
struct ExitCallback {
void (*cb_)(void* arg);
void* arg_;