diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-06 00:50:24 +0300 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2019-11-17 10:59:11 +0300 |
commit | b744070d74c710ea884512cb2998e7f2bb837a2c (patch) | |
tree | 6c1b2f2774e523b503b1d8696cf1db0dbd4ae7c0 /src/env.h | |
parent | de68720908bc783cadd811e84de7837fb4fa6759 (diff) |
src: allow adding linked bindings to Environment
This allows manually adding linked bindings to an `Environment`
instance, without having to register modules at program load in
a global namespace.
PR-URL: https://github.com/nodejs/node/pull/30274
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/env.h b/src/env.h index e5490c0a5b0..3e3aacc8f75 100644 --- a/src/env.h +++ b/src/env.h @@ -1069,11 +1069,15 @@ class Environment : public MemoryRetainer { inline bool owns_inspector() const; inline uint64_t thread_id() const; inline worker::Worker* worker_context() const; + Environment* worker_parent_env() const; inline void set_worker_context(worker::Worker* context); inline void add_sub_worker_context(worker::Worker* context); inline void remove_sub_worker_context(worker::Worker* context); void stop_sub_worker_contexts(); inline bool is_stopping() const; + inline std::list<node_module>* extra_linked_bindings(); + inline node_module* extra_linked_bindings_head(); + inline const Mutex& extra_linked_bindings_mutex() const; inline void ThrowError(const char* errmsg); inline void ThrowTypeError(const char* errmsg); @@ -1369,6 +1373,9 @@ class Environment : public MemoryRetainer { worker::Worker* worker_context_ = nullptr; + std::list<node_module> extra_linked_bindings_; + Mutex extra_linked_bindings_mutex_; + static void RunTimers(uv_timer_t* handle); struct ExitCallback { |