Chromium Code Reviews| Index: src/isolate.cc |
| diff --git a/src/isolate.cc b/src/isolate.cc |
| index 17762b2b0bf9b163cf405531ef97773e53e0495e..d87fd87af5aa1cf9a0383a7365d63d3998afce47 100644 |
| --- a/src/isolate.cc |
| +++ b/src/isolate.cc |
| @@ -347,20 +347,6 @@ RecursiveMutex Isolate::process_wide_mutex_; |
| Isolate::ThreadDataTable* Isolate::thread_data_table_ = NULL; |
| Atomic32 Isolate::isolate_counter_ = 0; |
| -Isolate::PerIsolateThreadData* Isolate::AllocatePerIsolateThreadData( |
| - ThreadId thread_id) { |
| - ASSERT(!thread_id.Equals(ThreadId::Invalid())); |
| - PerIsolateThreadData* per_thread = new PerIsolateThreadData(this, thread_id); |
| - { |
| - LockGuard<RecursiveMutex> lock_guard(&process_wide_mutex_); |
| - ASSERT(thread_data_table_->Lookup(this, thread_id) == NULL); |
| - thread_data_table_->Insert(per_thread); |
| - ASSERT(thread_data_table_->Lookup(this, thread_id) == per_thread); |
| - } |
| - return per_thread; |
| -} |
| - |
| - |
| Isolate::PerIsolateThreadData* |
| Isolate::FindOrAllocatePerThreadDataForThisThread() { |
| ThreadId thread_id = ThreadId::Current(); |
| @@ -369,9 +355,11 @@ Isolate::PerIsolateThreadData* |
| LockGuard<RecursiveMutex> lock_guard(&process_wide_mutex_); |
| per_thread = thread_data_table_->Lookup(this, thread_id); |
| if (per_thread == NULL) { |
| - per_thread = AllocatePerIsolateThreadData(thread_id); |
| + per_thread = new PerIsolateThreadData(this, thread_id); |
| + thread_data_table_->Insert(per_thread); |
|
Benedikt Meurer
2013/09/06 12:54:08
With this change, the process_wide_mutex_ can be t
|
| } |
| } |
| + ASSERT(thread_data_table_->Lookup(this, thread_id) == per_thread); |
| return per_thread; |
| } |
| @@ -1717,15 +1705,6 @@ void Isolate::ThreadDataTable::Remove(PerIsolateThreadData* data) { |
| } |
| -void Isolate::ThreadDataTable::Remove(Isolate* isolate, |
| - ThreadId thread_id) { |
| - PerIsolateThreadData* data = Lookup(isolate, thread_id); |
| - if (data != NULL) { |
| - Remove(data); |
| - } |
| -} |
| - |
| - |
| void Isolate::ThreadDataTable::RemoveAllThreads(Isolate* isolate) { |
| PerIsolateThreadData* data = list_; |
| while (data != NULL) { |