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

Side by Side Diff: base/tracked_objects.cc

Issue 8431003: Revert 107944 - Avoid all unnecessary calls to TLS during thread teardown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/tracked_objects.h" 5 #include "base/tracked_objects.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 worker_thread_data = new ThreadData(); 196 worker_thread_data = new ThreadData();
197 197
198 tls_index_.Set(worker_thread_data); 198 tls_index_.Set(worker_thread_data);
199 return worker_thread_data; 199 return worker_thread_data;
200 } 200 }
201 201
202 // static 202 // static
203 void ThreadData::OnThreadTermination(void* thread_data) { 203 void ThreadData::OnThreadTermination(void* thread_data) {
204 if (!kTrackAllTaskObjects) 204 if (!kTrackAllTaskObjects)
205 return; // Not compiled in. 205 return; // Not compiled in.
206 DCHECK(tls_index_.initialized());
206 if (!thread_data) 207 if (!thread_data)
207 return; 208 return;
208 reinterpret_cast<ThreadData*>(thread_data)->OnThreadTerminationCleanup(); 209 reinterpret_cast<ThreadData*>(thread_data)->OnThreadTerminationCleanup();
209 } 210 }
210 211
211 void ThreadData::OnThreadTerminationCleanup() const { 212 void ThreadData::OnThreadTerminationCleanup() const {
212 if (!is_a_worker_thread_) 213 if (!is_a_worker_thread_)
213 return; 214 return;
214 base::AutoLock lock(*list_lock_); 215 base::AutoLock lock(*list_lock_);
215 unregistered_thread_data_pool_->push(this); 216 unregistered_thread_data_pool_->push(this);
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
1135 (combined_selectors_ & BIRTH_THREAD) ? "*" : 1136 (combined_selectors_ & BIRTH_THREAD) ? "*" :
1136 sample.birth().birth_thread()->thread_name().c_str(), 1137 sample.birth().birth_thread()->thread_name().c_str(),
1137 (combined_selectors_ & DEATH_THREAD) ? "*" : 1138 (combined_selectors_ & DEATH_THREAD) ? "*" :
1138 sample.DeathThreadName().c_str()); 1139 sample.DeathThreadName().c_str());
1139 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), 1140 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE),
1140 !(combined_selectors_ & BIRTH_FUNCTION), 1141 !(combined_selectors_ & BIRTH_FUNCTION),
1141 output); 1142 output);
1142 } 1143 }
1143 1144
1144 } // namespace tracked_objects 1145 } // namespace tracked_objects
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698