Home | History | Annotate | Download | only in base

Lines Matching full:threaddata

67 // Location instance, as well as a pointer to the ThreadData bound to the thread
68 // on which the birth takes place (see discussion on ThreadData below). There is
69 // at most one Births instance for each Location / ThreadData pair. The derived
77 // the ThreadData is bound at a given time.
92 // the product of the number of ThreadData instances and the number of
98 // collection of DeathData instances. For each Births / death ThreadData pair,
101 // is destroyed (dies). Since a ThreadData is bound to at most one thread at a
110 // A ThreadData instance maintains maps of Births and DeathData instances. The
116 // The first time that a thread calls ThreadData::InitializeThreadContext() or
117 // ThreadData::Get(), a ThreadData instance is bound to it and stored in TLS. If
118 // a ThreadData bound to a terminated thread with the same sanitized name (i.e.
120 // reused. Otherwise, a new ThreadData instance is instantiated. Since a
121 // ThreadData is bound to at most one thread at a time, there is no need to
122 // acquire a lock to access its maps. Over time, a ThreadData may be bound to
125 // We maintain a list of all ThreadData instances for the current process. Each
126 // ThreadData instance has a pointer to the next one. A static member of
127 // ThreadData provides a pointer to the first item on this global list, and
131 // When new ThreadData instances are added to the global list, they are pre-
166 // list of ThreadData objects for a process for a concrete profiling phase. It
208 class ThreadData;
211 BirthOnThread(const Location& location, const ThreadData& current);
214 const ThreadData* birth_thread() const { return birth_thread_; }
224 const ThreadData* const birth_thread_;
246 Births(const Location& location, const ThreadData& current);
335 // ThreadData::SnapshotMaps (which takes DeathData snapshot) in a given process
498 // For each thread, we have a ThreadData that stores all tracking info generated
500 // We use ThreadLocalStorage to quickly identfy the current ThreadData context.
501 // We also have a linked list of ThreadData instances, and that list is used to
509 // representation of the list of ThreadData objects that died during the given
513 class BASE_EXPORT ThreadData {
528 // Initialize the current thread context with a new instance of ThreadData.
537 static ThreadData* Get();
640 explicit ThreadData(const std::string& sanitized_thread_name);
641 ~ThreadData();
648 // (Thread safe) Get start of list of all ThreadData instances using the lock.
649 static ThreadData* first();
651 // Iterate through the null terminated list of ThreadData instances.
652 ThreadData* next() const;
690 // can save all the thread data into a cache of reusable ThreadData instances.
696 // true, and the data structures (birth maps, death maps, ThreadData
701 // ThreadData instances.
704 // Returns a ThreadData instance for a thread whose sanitized name is
706 // the list of retired ThreadData instances or newly allocated.
707 static ThreadData* GetRetiredOrCreateThreadData(
714 // We use thread local store to identify which ThreadData to interact with.
717 // Linked list of ThreadData instances that were associated with threads that
720 static ThreadData* first_retired_thread_data_;
725 static ThreadData* all_thread_data_list_head_;
727 // The number of times TLS has called us back to cleanup a ThreadData
748 ThreadData* next_;
750 // Pointer to another retired ThreadData instance. This value is nullptr if
752 ThreadData* next_retired_thread_data_;
794 DISALLOW_COPY_AND_ASSIGN(ThreadData);
832 ThreadData* GetThreadData() const;
847 ThreadData* current_thread_data_;
870 // A snapshotted representation of the list of ThreadData objects for a process,
883 // A snapshotted representation of the list of ThreadData objects for a process,