| 1721 | } |
| 1722 | |
| 1723 | TraceLog::PerThreadInfo* TraceLog::SetupThreadLocalBuffer() { |
| 1724 | int64_t cur_tid = Thread::UniqueThreadId(); |
| 1725 | |
| 1726 | auto thr_info = new PerThreadInfo(); |
| 1727 | thr_info->event_buffer_ = nullptr; |
| 1728 | thr_info->is_in_trace_event_ = 0; |
| 1729 | thread_local_info_ = thr_info; |
| 1730 | |
| 1731 | threadlocal::internal::AddDestructor(&TraceLog::ThreadExitingCB, this); |
| 1732 | |
| 1733 | { |
| 1734 | MutexLock lock(active_threads_lock_); |
| 1735 | InsertOrDie(&active_threads_, cur_tid, thr_info); |
| 1736 | } |
| 1737 | return thr_info; |
| 1738 | } |
| 1739 | |
| 1740 | void TraceLog::ThreadExitingCB(void* arg) { |
| 1741 | static_cast<TraceLog*>(arg)->ThreadExiting(); |
nothing calls this directly
no test coverage detected