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 @@ -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
406398void Worker::JoinThread () {
Original file line number Diff line number Diff 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 ;
You can’t perform that action at this time.
0 commit comments