Skip to content

Commit 60de60a

Browse files
addaleaxdanbev
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 ee9e689 commit 60de60a

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

src/node_worker.cc

+5-13
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,6 @@ void Worker::Run() {
251251
Isolate::DisallowJavascriptExecutionScope disallow_js(isolate_,
252252
Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
253253

254-
// Grab the parent-to-child channel and render is unusable.
255-
MessagePort* child_port;
256-
{
257-
Mutex::ScopedLock lock(mutex_);
258-
child_port = child_port_;
259-
child_port_ = nullptr;
260-
}
261-
262254
{
263255
Context::Scope context_scope(env_->context());
264256
{
@@ -394,13 +386,13 @@ void Worker::CreateEnvMessagePort(Environment* env) {
394386
HandleScope handle_scope(isolate_);
395387
Mutex::ScopedLock lock(mutex_);
396388
// Set up the message channel for receiving messages in the child.
397-
child_port_ = MessagePort::New(env,
398-
env->context(),
399-
std::move(child_port_data_));
389+
MessagePort* child_port = MessagePort::New(env,
390+
env->context(),
391+
std::move(child_port_data_));
400392
// MessagePort::New() may return nullptr if execution is terminated
401393
// within it.
402-
if (child_port_ != nullptr)
403-
env->set_message_port(child_port_->object(isolate_));
394+
if (child_port != nullptr)
395+
env->set_message_port(child_port->object(isolate_));
404396
}
405397

406398
void Worker::JoinThread() {

src/node_worker.h

-3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,6 @@ class Worker : public AsyncWrap {
100100
std::unique_ptr<MessagePortData> child_port_data_;
101101
std::shared_ptr<KVStore> env_vars_;
102102

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

0 commit comments

Comments
 (0)