Index: src/v8threads.cc |
=================================================================== |
--- src/v8threads.cc (revision 2968) |
+++ src/v8threads.cc (working copy) |
@@ -77,7 +77,9 @@ |
Locker::~Locker() { |
ASSERT(internal::ThreadManager::IsLockedByCurrentThread()); |
if (has_lock_) { |
- if (!top_level_) { |
+ if (top_level_) { |
+ internal::ThreadManager::FreeThreadResources(); |
+ } else { |
internal::ThreadManager::ArchiveThread(); |
} |
internal::ThreadManager::Unlock(); |
@@ -284,6 +286,18 @@ |
} |
+void ThreadManager::FreeThreadResources() { |
+ HandleScopeImplementer::FreeThreadResources(); |
+ Top::FreeThreadResources(); |
+#ifdef ENABLE_DEBUGGER_SUPPORT |
+ Debug::FreeThreadResources(); |
+#endif |
+ StackGuard::FreeThreadResources(); |
+ RegExpStack::FreeThreadResources(); |
+ Bootstrapper::FreeThreadResources(); |
+} |
+ |
+ |
bool ThreadManager::IsArchived() { |
return Thread::HasThreadLocal(thread_state_key); |
} |