Chromium Code Reviews| Index: base/tracked_objects.h |
| =================================================================== |
| --- base/tracked_objects.h (revision 110865) |
| +++ base/tracked_objects.h (working copy) |
| @@ -532,6 +532,11 @@ |
| // the code). |
| static TrackedTime Now(); |
| + // This function can be called at process termination to validate that thread |
| + // cleanup routines have been called for at least some number of named |
| + // threads. |
| + static void EnsureCleanupWasCalled(int major_threads_shutdown_count); |
| + |
| private: |
| // Allow only tests to call ShutdownSingleThreadedCleanup. We NEVER call it |
| // in production code. |
| @@ -596,7 +601,10 @@ |
| static ThreadData* all_thread_data_list_head_; |
| // The next available thread number. This should only be accessed when the |
| // list_lock_ is held. |
|
ramant (doing other things)
2011/11/21 04:14:06
nit: should we consider adjusting comments?
jar (doing other things)
2011/11/21 17:22:30
Done.
|
| - static int thread_number_counter_; |
| + static int worker_thread_data_creation_count_; |
| + // The number of times TLS has called us back to cleanup a ThreadData |
| + // instance. This is only accessed while list_lock_ is held. |
| + static int cleanup_count_; |
| // Incarnation sequence number, indicating how many times (during unittests) |
| // we've either transitioned out of UNINITIALIZED, or into that state. This |
| // value is only accessed while the list_lock_ is held. |
| @@ -606,7 +614,7 @@ |
| // The lock is very infrequently used, so we can afford to just make a lazy |
| // instance and be safe. |
| static base::LazyInstance<base::Lock, |
| - base::LeakyLazyInstanceTraits<base::Lock> > list_lock_; |
| + base::LeakyLazyInstanceTraits<base::Lock> > list_lock_; |
| // Record of what the incarnation_counter_ was when this instance was created. |
| // If the incarnation_counter_ has changed, then we avoid pushing into the |
| @@ -655,7 +663,7 @@ |
| // thread, or reading from another thread. For reading from this thread we |
| // don't need a lock, as there is no potential for a conflict since the |
| // writing is only done from this thread. |
| - mutable base::Lock lock_; |
| + mutable base::Lock map_lock_; |
| DISALLOW_COPY_AND_ASSIGN(ThreadData); |
| }; |