Skip to content

Commit

Permalink
src: remove unused Worker::child_port_ member
Browse files Browse the repository at this point in the history
This fixes a compiler warning introduced in 9225939.

PR-URL: #31599
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
addaleax authored and codebytere committed Mar 17, 2020
1 parent 40f57da commit f434c8c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
18 changes: 5 additions & 13 deletions src/node_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,6 @@ void Worker::Run() {
Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_,
Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);

// Grab the parent-to-child channel and render is unusable.
MessagePort* child_port;
{
Mutex::ScopedLock lock(mutex_);
child_port = child_port_;
child_port_ = nullptr;
}

{
Context::Scope context_scope(env_->context());
{
Expand Down Expand Up @@ -396,13 +388,13 @@ void Worker::CreateEnvMessagePort(Environment* env) {
HandleScope handle_scope(isolate_);
Mutex::ScopedLock lock(mutex_);
// Set up the message channel for receiving messages in the child.
child_port_ = MessagePort::New(env,
env->context(),
std::move(child_port_data_));
MessagePort* child_port = MessagePort::New(env,
env->context(),
std::move(child_port_data_));
// MessagePort::New() may return nullptr if execution is terminated
// within it.
if (child_port_ != nullptr)
env->set_message_port(child_port_->object(isolate_));
if (child_port != nullptr)
env->set_message_port(child_port->object(isolate_));
}

void Worker::JoinThread() {
Expand Down
3 changes: 0 additions & 3 deletions src/node_worker.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ class Worker : public AsyncWrap {
std::unique_ptr<MessagePortData> child_port_data_;
std::shared_ptr<KVStore> env_vars_;

// The child port is kept alive by the child Environment's persistent
// handle to it, as long as that child Environment exists.
MessagePort* child_port_ = nullptr;
// This is always kept alive because the JS object associated with the Worker
// instance refers to it via its [kPort] property.
MessagePort* parent_port_ = nullptr;
Expand Down

0 comments on commit f434c8c

Please sign in to comment.