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() {
253
253
Isolate::DisallowJavascriptExecutionScope disallow_js (isolate_,
254
254
Isolate::DisallowJavascriptExecutionScope::THROW_ON_FAILURE);
255
255
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
-
264
256
{
265
257
Context::Scope context_scope (env_->context ());
266
258
{
@@ -396,13 +388,13 @@ void Worker::CreateEnvMessagePort(Environment* env) {
396
388
HandleScope handle_scope (isolate_);
397
389
Mutex::ScopedLock lock (mutex_);
398
390
// 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_));
402
394
// MessagePort::New() may return nullptr if execution is terminated
403
395
// 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_));
406
398
}
407
399
408
400
void Worker::JoinThread () {
Original file line number Diff line number Diff line change @@ -102,9 +102,6 @@ class Worker : public AsyncWrap {
102
102
std::unique_ptr<MessagePortData> child_port_data_;
103
103
std::shared_ptr<KVStore> env_vars_;
104
104
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 ;
108
105
// This is always kept alive because the JS object associated with the Worker
109
106
// instance refers to it via its [kPort] property.
110
107
MessagePort* parent_port_ = nullptr ;
You can’t perform that action at this time.
0 commit comments