Lines Matching refs:threadContext
46 void CreateContext(std::shared_ptr<ThreadContext>& threadContext)
49 std::unique_lock<std::mutex> lock(threadContext->mtx);
50 if (threadContext->ctx == nullptr) {
51 threadContext->ctx = new ucontext_t;
53 (void)memset_s(threadContext->ctx, sizeof(ucontext_t), 0, sizeof(ucontext_t));
57 void ReleaseContext(std::shared_ptr<ThreadContext> threadContext)
60 std::unique_lock<std::mutex> lock(threadContext->mtx);
61 if (threadContext->ctx != nullptr) {
62 delete threadContext->ctx;
63 threadContext->ctx = nullptr;
72 auto threadContext = std::make_shared<ThreadContext>();
73 threadContext->tid = tid;
74 threadContext->frameSz = 0;
75 CreateContext(threadContext);
76 g_contextMap[tid] = threadContext;
77 return threadContext;
167 auto threadContext = GetContextLocked(tid);
168 if (threadContext == nullptr) {
174 if (!SignalRequestThread(tid, threadContext.get())) {
177 if (threadContext->cv.wait_for(lock, g_timeOut) == std::cv_status::timeout) {
181 return threadContext;
254 bool LocalThreadContext::SignalRequestThread(int32_t tid, ThreadContext* threadContext)
260 si.si_value.sival_ptr = reinterpret_cast<void *>(threadContext);
263 threadContext->tid = static_cast<int32_t>(ThreadContextStatus::CONTEXT_UNUSED);