File tree Expand file tree Collapse file tree 2 files changed +5
-16
lines changed Expand file tree Collapse file tree 2 files changed +5
-16
lines changed Original file line number Diff line number Diff 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
408400void Worker::JoinThread () {
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments