diff options
author | Anna Henningsen <anna@addaleax.net> | 2019-11-12 21:57:10 +0300 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2020-03-21 12:57:15 +0300 |
commit | 64c01222d9b62942f356048026742a7c8d778cef (patch) | |
tree | f5d59c4fcfb8b80069c8c7ab9ed04a01e12f5fcd /src/node_worker.cc | |
parent | 288382a4ce4c1eb5d6eaccf698099804f6a3697d (diff) |
src: move worker_context from Environment to IsolateData
Workers are fully in control of their Isolates, and this helps
avoid a problem with later changes to `CreateEnvironment()`
because now we can run the boostrapping code inside the latter.
PR-URL: https://github.com/nodejs/node/pull/30467
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Diffstat (limited to 'src/node_worker.cc')
-rw-r--r-- | src/node_worker.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_worker.cc b/src/node_worker.cc index 1e1877e026c..e71866b9b1f 100644 --- a/src/node_worker.cc +++ b/src/node_worker.cc @@ -183,6 +183,7 @@ class WorkerThreadData { CHECK(isolate_data_); if (w_->per_isolate_opts_) isolate_data_->set_options(std::move(w_->per_isolate_opts_)); + isolate_data_->set_worker_context(w_); } Mutex::ScopedLock lock(w_->mutex_); @@ -317,7 +318,6 @@ void Worker::Run() { CHECK_NOT_NULL(env_); env_->set_env_vars(std::move(env_vars_)); env_->set_abort_on_uncaught_exception(false); - env_->set_worker_context(this); env_->InitializeLibuv(start_profiler_idle_notifier_); } |