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

Unified Diff: src/isolate.cc

Issue 7129002: Fix bug 1433: clear the global thread table when an isolate is disposed. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 6 months 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
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index 12c9753bfa4b943e3013c9628f07ce8a239f1f8d..1d8a8258d4bd5ef4921183c0ff7676ff410763ae 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1307,6 +1307,7 @@ char* Isolate::RestoreThread(char* from) {
if (RuntimeProfiler::IsEnabled() && current_vm_state() == JS) {
RuntimeProfiler::IsolateEnteredJS(this);
}
+ ASSERT(context() == NULL || context()->IsContext());
#endif
return from + sizeof(ThreadLocalTop);
}
@@ -1350,6 +1351,16 @@ void Isolate::ThreadDataTable::Remove(Isolate* isolate,
}
+void Isolate::ThreadDataTable::RemoveAllThreads(Isolate* isolate) {
+ PerIsolateThreadData* data = list_;
+ while (data != NULL) {
+ PerIsolateThreadData* next = data->next_;
+ if (data->isolate() == isolate) Remove(data);
+ data = next;
+ }
+}
+
+
#ifdef DEBUG
#define TRACE_ISOLATE(tag) \
do { \
@@ -1464,6 +1475,10 @@ void Isolate::TearDown() {
Deinit();
+ { ScopedLock lock(process_wide_mutex_);
+ thread_data_table_->RemoveAllThreads(this);
+ }
+
if (!IsDefaultIsolate()) {
delete this;
}
« no previous file with comments | « src/isolate.h ('k') | test/cctest/test-lockers.cc » ('j') | test/cctest/test-lockers.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698