diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-01 23:47:38 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-05 21:55:54 +0100 |
commit | 39eca841c30e1a54424b85f34e8dd56b2648f930 (patch) | |
tree | 2ab9c7bc285e20f85cefff16c6441c726bbed126 /src/env.h | |
parent | 8d63f4037e52eda125c5a70dafa602f47c13d0ad (diff) | |
download | android-node-v8-39eca841c30e1a54424b85f34e8dd56b2648f930.tar.gz android-node-v8-39eca841c30e1a54424b85f34e8dd56b2648f930.tar.bz2 android-node-v8-39eca841c30e1a54424b85f34e8dd56b2648f930.zip |
src: split ownsProcessState off isMainThread
Embedders may want to control whether a Node.js instance
controls the current process, similar to what we currently
have with `Worker`s.
Previously, the `isMainThread` flag had a bit of a double usage,
both for indicating whether we are (not) running a Worker and
whether we can modify per-process state.
PR-URL: https://github.com/nodejs/node/pull/25881
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -599,7 +599,9 @@ class Environment { enum Flags { kNoFlags = 0, - kIsMainThread = 1 + kIsMainThread = 1 << 0, + kOwnsProcessState = 1 << 1, + kOwnsInspector = 1 << 2, }; static inline Environment* GetCurrent(v8::Isolate* isolate); @@ -768,6 +770,8 @@ class Environment { inline void set_has_run_bootstrapping_code(bool has_run_bootstrapping_code); inline bool is_main_thread() const; + inline bool owns_process_state() const; + inline bool owns_inspector() const; inline uint64_t thread_id() const; inline worker::Worker* worker_context() const; inline void set_worker_context(worker::Worker* context); |