diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-02-08 19:22:35 +0100 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2019-02-11 19:57:14 +0100 |
commit | 58ba8bfc46c06bf9f75887c18df563d91a1f782c (patch) | |
tree | 30e85762e7807e4c6e1c821d1fbf69fc33409ec9 /src/env.h | |
parent | e11388b245d9822fcaf2209baaa9e1958d102d2d (diff) | |
download | android-node-v8-58ba8bfc46c06bf9f75887c18df563d91a1f782c.tar.gz android-node-v8-58ba8bfc46c06bf9f75887c18df563d91a1f782c.tar.bz2 android-node-v8-58ba8bfc46c06bf9f75887c18df563d91a1f782c.zip |
worker: pre-allocate thread id
Allocate a thread id before actually creating the Environment instance.
PR-URL: https://github.com/nodejs/node/pull/26011
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'src/env.h')
-rw-r--r-- | src/env.h | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -618,7 +618,8 @@ class Environment { Environment(IsolateData* isolate_data, v8::Local<v8::Context> context, - Flags flags = Flags()); + Flags flags = Flags(), + uint64_t thread_id = kNoThreadId); ~Environment(); void Start(bool start_profiler_idle_notifier); @@ -763,6 +764,9 @@ class Environment { inline bool has_run_bootstrapping_code() const; inline void set_has_run_bootstrapping_code(bool has_run_bootstrapping_code); + static uint64_t AllocateThreadId(); + static constexpr uint64_t kNoThreadId = -1; + inline bool is_main_thread() const; inline bool owns_process_state() const; inline bool owns_inspector() const; |