Skip to content

Commit ae9ea95

Browse files
addaleaxcodebytere
authored andcommitted
src: remove unused Worker::child_port_ member
This fixes a compiler warning introduced in 9225939. PR-URL: #31599 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 250479a commit ae9ea95

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

src/node_worker.cc

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,6 @@ void Worker::Run() {
253253
Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_,
254254
Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
255255

256-
// Grab the parent-to-child channel and render is unusable.
257-
MessagePort* child_port;
258-
{
259-
Mutex::ScopedLock lock(mutex_);
260-
child_port = child_port_;
261-
child_port_ = nullptr;
262-
}
263-
264256
{
265257
Context::Scope context_scope(env_->context());
266258
{
@@ -396,13 +388,13 @@ void Worker::CreateEnvMessagePort(Environment* env) {
396388
HandleScope handle_scope(isolate_);
397389
Mutex::ScopedLock lock(mutex_);
398390
// Set up the message channel for receiving messages in the child.
399-
child_port_ = MessagePort::New(env,
400-
env->context(),
401-
std::move(child_port_data_));
391+
MessagePort* child_port = MessagePort::New(env,
392+
env->context(),
393+
std::move(child_port_data_));
402394
// MessagePort::New() may return nullptr if execution is terminated
403395
// within it.
404-
if (child_port_ != nullptr)
405-
env->set_message_port(child_port_->object(isolate_));
396+
if (child_port != nullptr)
397+
env->set_message_port(child_port->object(isolate_));
406398
}
407399

408400
void Worker::JoinThread() {

src/node_worker.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ class Worker : public AsyncWrap {
102102
std::unique_ptr<MessagePortData> child_port_data_;
103103
std::shared_ptr<KVStore> env_vars_;
104104

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

0 commit comments

Comments
 (0)