| Index: src/api.cc
|
| diff --git a/src/api.cc b/src/api.cc
|
| index 52a84edfdabf6e797b3d87cd1b2786eb6bfdd5a2..3c9d1f4e2bec447fd6c9aa831a69af68c26179e1 100644
|
| --- a/src/api.cc
|
| +++ b/src/api.cc
|
| @@ -673,6 +673,14 @@ void V8::DisposeGlobal(i::Object** obj) {
|
|
|
| HandleScope::HandleScope() {
|
| i::Isolate* isolate = i::Isolate::Current();
|
| + if (i::FLAG_optimize_in_parallel &&
|
| + !isolate->thread_manager()->IsLockedByCurrentThread()) {
|
| + has_isolate_lock_ = true;
|
| + isolate->thread_manager()->Lock();
|
| + } else {
|
| + has_isolate_lock_ = false;
|
| + }
|
| +
|
| API_ENTRY_CHECK(isolate, "HandleScope::HandleScope");
|
| v8::ImplementationUtilities::HandleScopeData* current =
|
| isolate->handle_scope_data();
|
| @@ -688,6 +696,9 @@ HandleScope::~HandleScope() {
|
| if (!is_closed_) {
|
| Leave();
|
| }
|
| + if (has_isolate_lock_) {
|
| + isolate_->thread_manager()->Unlock();
|
| + }
|
| }
|
|
|
|
|
|
|