Lines Matching defs:tid

68 std::shared_ptr<ThreadContext> GetContextLocked(int32_t tid)
70 auto it = g_contextMap.find(tid);
73 threadContext->tid = tid;
76 g_contextMap[tid] = threadContext;
80 if (it->second->tid == ThreadContextStatus::CONTEXT_UNUSED) {
81 it->second->tid = tid;
86 DFXLOGE("GetContextLocked nullptr, tid: %{public}d", tid);
90 AT_UNUSED bool RemoveContextLocked(int32_t tid)
92 auto it = g_contextMap.find(tid);
94 DFXLOGW("Context of tid(%{public}d) is already removed.", tid);
103 if (it->second->tid == ThreadContextStatus::CONTEXT_UNUSED) {
108 DFXLOGW("Failed to release context of tid(%{public}d), still using?", tid);
121 if (it->second->tid == ThreadContextStatus::CONTEXT_UNUSED) {
137 NO_SANITIZE std::shared_ptr<ThreadContext> LocalThreadContext::GetThreadContext(int32_t tid)
140 auto it = g_contextMap.find(tid);
144 DFXLOGW("Failed to get context of tid(%{public}d)", tid);
148 void LocalThreadContext::ReleaseThread(int32_t tid)
151 auto it = g_contextMap.find(tid);
164 std::shared_ptr<ThreadContext> LocalThreadContext::CollectThreadContext(int32_t tid)
167 auto threadContext = GetContextLocked(tid);
169 DFXLOGW("Failed to get context of tid(%{public}d), still using?", tid);
174 if (!SignalRequestThread(tid, threadContext.get())) {
178 DFXLOGE("wait_for timeout. tid = %{public}d", tid);
190 DFXLOGU("tid(%{public}d) recv sig(%{public}d)", gettid(), sig);
198 ctxPtr->tid = static_cast<int32_t>(ThreadContextStatus::CONTEXT_UNUSED);
204 ctxPtr->tid = static_cast<int32_t>(ThreadContextStatus::CONTEXT_UNUSED);
208 int tid = gettid();
211 DFXLOGW("Failed to copy local ucontext with tid(%{public}d)", tid);
214 if (tid != getpid()) {
216 DFXLOGW("Failed to get stack range with tid(%{public}d)", tid);
220 ctxPtr->tid = static_cast<int32_t>(ThreadContextStatus::CONTEXT_READY);
223 ctxPtr->tid = static_cast<int32_t>(ThreadContextStatus::CONTEXT_UNUSED);
227 bool LocalThreadContext::GetStackRange(int32_t tid, uintptr_t& stackBottom, uintptr_t& stackTop)
229 auto ctxPtr = LocalThreadContext::GetInstance().GetThreadContext(tid);
254 bool LocalThreadContext::SignalRequestThread(int32_t tid, ThreadContext* threadContext)
261 if (syscall(SYS_rt_tgsigqueueinfo, getpid(), tid, si.si_signo, &si) != 0) {
262 DFXLOGW("Failed to send signal(%{public}d) to tid(%{public}d), errno(%{public}d).", si.si_signo, tid, errno);
263 threadContext->tid = static_cast<int32_t>(ThreadContextStatus::CONTEXT_UNUSED);