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