GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — worker: only stop inspector if started · nodejs/node@b5889d0

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • node_worker.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_worker.cc‎

Copy file name to clipboardExpand all lines: src/node_worker.cc
+6-2Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ void Worker::Run() {
136136
TRACE_STR_COPY(name.c_str()));
137137
MultiIsolatePlatform* platform = isolate_data_->platform();
138138
CHECK_NE(platform, nullptr);
139+
bool inspector_started = false;
139140

140141
Debug(this, "Starting worker with id %llu", thread_id_);
141142
{
@@ -163,6 +164,9 @@ void Worker::Run() {
163164
}
164165

165166
if (!is_stopped()) {
167+
StartWorkerInspector(env_.get(), url_);
168+
inspector_started = true;
169+
166170
HandleScope handle_scope(isolate_);
167171
Environment::AsyncCallbackScope callback_scope(env_.get());
168172
env_->async_hooks()->push_async_ids(1, 0);
@@ -171,7 +175,6 @@ void Worker::Run() {
171175
env_->async_hooks()->pop_async_id(1);
172176

173177
Debug(this, "Loaded environment for worker %llu", thread_id_);
174-
StartWorkerInspector(env_.get(), url_);
175178
}
176179

177180
{
@@ -232,7 +235,8 @@ void Worker::Run() {
232235
env_->stop_sub_worker_contexts();
233236
env_->RunCleanup();
234237
RunAtExit(env_.get());
235-
WaitForWorkerInspectorToStop(env_.get());
238+
if (inspector_started)
239+
WaitForWorkerInspectorToStop(env_.get());
236240

237241
{
238242
Mutex::ScopedLock stopped_lock(stopped_mutex_);

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.