| Index: src/v8threads.cc
|
| diff --git a/src/v8threads.cc b/src/v8threads.cc
|
| index fd8d5364011cdee45c196cd58550fa31313cb9d7..25d7b90f78b693ae8f3285d9d2c176bb8806cf68 100644
|
| --- a/src/v8threads.cc
|
| +++ b/src/v8threads.cc
|
| @@ -103,7 +103,7 @@ Locker::~Locker() {
|
| ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
|
| if (has_lock_) {
|
| if (isolate_->IsDefaultIsolate()) {
|
| - isolate_->Exit();
|
| + isolate_->Exit(false);
|
| }
|
| if (top_level_) {
|
| isolate_->thread_manager()->FreeThreadResources();
|
| @@ -122,7 +122,9 @@ Unlocker::Unlocker(v8::Isolate* isolate)
|
| }
|
| ASSERT(isolate_->thread_manager()->IsLockedByCurrentThread());
|
| if (isolate_->IsDefaultIsolate()) {
|
| - isolate_->Exit();
|
| + // Small hack to make sure ArchiveThread does not see an unlocked
|
| + // view of the isolate.
|
| + isolate_->Exit(false);
|
| }
|
| isolate_->thread_manager()->ArchiveThread();
|
| isolate_->thread_manager()->Unlock();
|
| @@ -210,6 +212,7 @@ bool ThreadManager::RestoreThread() {
|
|
|
|
|
| void ThreadManager::Lock() {
|
| + ASSERT(!IsLockedByCurrentThread());
|
| mutex_->Lock();
|
| mutex_owner_ = ThreadId::Current();
|
| ASSERT(IsLockedByCurrentThread());
|
| @@ -217,6 +220,7 @@ void ThreadManager::Lock() {
|
|
|
|
|
| void ThreadManager::Unlock() {
|
| + ASSERT(IsLockedByCurrentThread());
|
| mutex_owner_ = ThreadId::Invalid();
|
| mutex_->Unlock();
|
| }
|
|
|