Index: src/isolate.cc |
diff --git a/src/isolate.cc b/src/isolate.cc |
index 927989f367f053979a87e6c357433581e1074a0d..77611c782e2f0dde7e4d0cf84ab976b50c6c9dec 100644 |
--- a/src/isolate.cc |
+++ b/src/isolate.cc |
@@ -135,6 +135,22 @@ Isolate::PerIsolateThreadData* |
} |
+void Isolate::DiscardPerThreadDataForThisThread() { |
+ int thread_id_int = base::Thread::GetThreadLocalInt(Isolate::thread_id_key_); |
+ if (thread_id_int) { |
+ ThreadId thread_id = ThreadId(thread_id_int); |
+ DCHECK(!thread_manager_->mutex_owner_.Equals(thread_id)); |
+ base::LockGuard<base::Mutex> lock_guard(thread_data_table_mutex_.Pointer()); |
+ PerIsolateThreadData* per_thread = |
+ thread_data_table_->Lookup(this, thread_id); |
+ if (per_thread) { |
+ DCHECK(!per_thread->thread_state_); |
+ thread_data_table_->Remove(per_thread); |
+ } |
+ } |
+} |
+ |
+ |
Isolate::PerIsolateThreadData* Isolate::FindPerThreadDataForThisThread() { |
ThreadId thread_id = ThreadId::Current(); |
return FindPerThreadDataForThread(thread_id); |