| 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 #ifndef BASE_TRACKED_OBJECTS_H_ | 5 #ifndef BASE_TRACKED_OBJECTS_H_ |
| 6 #define BASE_TRACKED_OBJECTS_H_ | 6 #define BASE_TRACKED_OBJECTS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 568 |
| 569 // Incarnation sequence number, indicating how many times (during unittests) | 569 // Incarnation sequence number, indicating how many times (during unittests) |
| 570 // we've either transitioned out of UNINITIALIZED, or into that state. This | 570 // we've either transitioned out of UNINITIALIZED, or into that state. This |
| 571 // value is only accessed while the list_lock_ is held. | 571 // value is only accessed while the list_lock_ is held. |
| 572 static int incarnation_counter_; | 572 static int incarnation_counter_; |
| 573 | 573 |
| 574 // Protection for access to all_thread_data_list_head_, and to | 574 // Protection for access to all_thread_data_list_head_, and to |
| 575 // unregistered_thread_data_pool_. This lock is leaked at shutdown. | 575 // unregistered_thread_data_pool_. This lock is leaked at shutdown. |
| 576 // The lock is very infrequently used, so we can afford to just make a lazy | 576 // The lock is very infrequently used, so we can afford to just make a lazy |
| 577 // instance and be safe. | 577 // instance and be safe. |
| 578 static base::LazyInstance<base::Lock, | 578 static base::LazyInstance<base::Lock>::Leaky list_lock_; |
| 579 base::LeakyLazyInstanceTraits<base::Lock> > list_lock_; | |
| 580 | 579 |
| 581 // We set status_ to SHUTDOWN when we shut down the tracking service. | 580 // We set status_ to SHUTDOWN when we shut down the tracking service. |
| 582 static Status status_; | 581 static Status status_; |
| 583 | 582 |
| 584 // Link to next instance (null terminated list). Used to globally track all | 583 // Link to next instance (null terminated list). Used to globally track all |
| 585 // registered instances (corresponds to all registered threads where we keep | 584 // registered instances (corresponds to all registered threads where we keep |
| 586 // data). | 585 // data). |
| 587 ThreadData* next_; | 586 ThreadData* next_; |
| 588 | 587 |
| 589 // Pointer to another ThreadData instance for a Worker-Thread that has been | 588 // Pointer to another ThreadData instance for a Worker-Thread that has been |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 } | 723 } |
| 725 | 724 |
| 726 private: | 725 private: |
| 727 | 726 |
| 728 DISALLOW_COPY_AND_ASSIGN(AutoTracking); | 727 DISALLOW_COPY_AND_ASSIGN(AutoTracking); |
| 729 }; | 728 }; |
| 730 | 729 |
| 731 } // namespace tracked_objects | 730 } // namespace tracked_objects |
| 732 | 731 |
| 733 #endif // BASE_TRACKED_OBJECTS_H_ | 732 #endif // BASE_TRACKED_OBJECTS_H_ |
| OLD | NEW |