OLD | NEW |
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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 DCHECK(tls_index_.initialized()); |
207 if (!thread_data) | 207 if (!thread_data) |
208 return; | 208 return; |
209 reinterpret_cast<ThreadData*>(thread_data)->OnThreadTerminationCleanup(); | 209 reinterpret_cast<ThreadData*>(thread_data)->OnThreadTerminationCleanup(); |
210 DCHECK_EQ(tls_index_.Get(), reinterpret_cast<ThreadData*>(NULL)); | |
211 } | 210 } |
212 | 211 |
213 void ThreadData::OnThreadTerminationCleanup() const { | 212 void ThreadData::OnThreadTerminationCleanup() const { |
214 if (!is_a_worker_thread_) | 213 if (!is_a_worker_thread_) |
215 return; | 214 return; |
216 base::AutoLock lock(*list_lock_); | 215 base::AutoLock lock(*list_lock_); |
217 unregistered_thread_data_pool_->push(this); | 216 unregistered_thread_data_pool_->push(this); |
218 } | 217 } |
219 | 218 |
220 // static | 219 // static |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1137 (combined_selectors_ & BIRTH_THREAD) ? "*" : | 1136 (combined_selectors_ & BIRTH_THREAD) ? "*" : |
1138 sample.birth().birth_thread()->thread_name().c_str(), | 1137 sample.birth().birth_thread()->thread_name().c_str(), |
1139 (combined_selectors_ & DEATH_THREAD) ? "*" : | 1138 (combined_selectors_ & DEATH_THREAD) ? "*" : |
1140 sample.DeathThreadName().c_str()); | 1139 sample.DeathThreadName().c_str()); |
1141 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), | 1140 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), |
1142 !(combined_selectors_ & BIRTH_FUNCTION), | 1141 !(combined_selectors_ & BIRTH_FUNCTION), |
1143 output); | 1142 output); |
1144 } | 1143 } |
1145 | 1144 |
1146 } // namespace tracked_objects | 1145 } // namespace tracked_objects |
OLD | NEW |