Commit d42e81d5 authored by binji's avatar binji Committed by Commit bot

d8 workers: fix race on quit() with context_mutex_

When quit() is called, d8 shell exits without cleanup. If a worker is running,
it might be holding the context_mutex_, which if destroyed will DCHECK.

BUG=4279
R=jarin@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1231473002

Cr-Commit-Position: refs/heads/master@{#29557}
parent 66f5779c
......@@ -810,6 +810,9 @@ void Shell::WorkerTerminate(const v8::FunctionCallbackInfo<v8::Value>& args) {
void Shell::Quit(const v8::FunctionCallbackInfo<v8::Value>& args) {
int exit_code = args[0]->Int32Value();
#ifndef V8_SHARED
CleanupWorkers();
#endif // !V8_SHARED
OnExit(args.GetIsolate());
exit(exit_code);
}
......
// Copyright 2015 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
if (this.Worker && this.quit) {
try {
new Function(new Worker("55"));
} catch(err) {}
quit();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment