| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 return false; // Not compiled in. | 460 return false; // Not compiled in. |
| 461 #endif | 461 #endif |
| 462 | 462 |
| 463 if (!status) { | 463 if (!status) { |
| 464 base::AutoLock lock(list_lock_); | 464 base::AutoLock lock(list_lock_); |
| 465 DCHECK(status_ == ACTIVE || status_ == SHUTDOWN); | 465 DCHECK(status_ == ACTIVE || status_ == SHUTDOWN); |
| 466 status_ = SHUTDOWN; | 466 status_ = SHUTDOWN; |
| 467 return true; | 467 return true; |
| 468 } | 468 } |
| 469 base::AutoLock lock(list_lock_); | 469 base::AutoLock lock(list_lock_); |
| 470 DCHECK(status_ == UNINITIALIZED); | 470 DCHECK_EQ(UNINITIALIZED, status_); |
| 471 CHECK(tls_index_.Initialize(NULL)); | 471 CHECK(tls_index_.Initialize(NULL)); |
| 472 status_ = ACTIVE; | 472 status_ = ACTIVE; |
| 473 return true; | 473 return true; |
| 474 } | 474 } |
| 475 | 475 |
| 476 // static | 476 // static |
| 477 bool ThreadData::IsActive() { | 477 bool ThreadData::IsActive() { |
| 478 return status_ == ACTIVE; | 478 return status_ == ACTIVE; |
| 479 } | 479 } |
| 480 | 480 |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1048 (combined_selectors_ & BIRTH_THREAD) ? "*" : | 1048 (combined_selectors_ & BIRTH_THREAD) ? "*" : |
| 1049 sample.birth().birth_thread()->ThreadName().c_str(), | 1049 sample.birth().birth_thread()->ThreadName().c_str(), |
| 1050 (combined_selectors_ & DEATH_THREAD) ? "*" : | 1050 (combined_selectors_ & DEATH_THREAD) ? "*" : |
| 1051 sample.DeathThreadName().c_str()); | 1051 sample.DeathThreadName().c_str()); |
| 1052 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), | 1052 sample.birth().location().Write(!(combined_selectors_ & BIRTH_FILE), |
| 1053 !(combined_selectors_ & BIRTH_FUNCTION), | 1053 !(combined_selectors_ & BIRTH_FUNCTION), |
| 1054 output); | 1054 output); |
| 1055 } | 1055 } |
| 1056 | 1056 |
| 1057 } // namespace tracked_objects | 1057 } // namespace tracked_objects |
| OLD | NEW |