summaryrefslogtreecommitdiff
path: root/src/env.h
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2019-02-01 23:47:38 +0100
committerAnna Henningsen <anna@addaleax.net>2019-02-05 21:55:54 +0100
commit39eca841c30e1a54424b85f34e8dd56b2648f930 (patch)
tree2ab9c7bc285e20f85cefff16c6441c726bbed126 /src/env.h
parent8d63f4037e52eda125c5a70dafa602f47c13d0ad (diff)
downloadandroid-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.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/env.h b/src/env.h
index f76fb14990..40bd0797a2 100644
--- a/src/env.h
+++ b/src/env.h
@@ -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);