Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1156)

Unified Diff: src/isolate.cc

Issue 1522703002: Add Isolate::DiscardThreadSpecificMetadata method to embedder API. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove rocketsoftware wildcard from AUTHORS Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.h ('k') | test/cctest/test-lockers.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/isolate.h ('k') | test/cctest/test-lockers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698