Lines Matching refs:thr
21 static u32 CurrentStackTrace(Thread *thr, uptr skip) { in CurrentStackTrace() argument
23 thr->ignore_interceptors = true; in CurrentStackTrace()
25 thr->ignore_interceptors = false; in CurrentStackTrace()
31 static void PrintStackTrace(Thread *thr, u32 stk) { in PrintStackTrace() argument
33 thr->ignore_interceptors = true; in PrintStackTrace()
35 thr->ignore_interceptors = false; in PrintStackTrace()
38 static void ReportDeadlock(Thread *thr, DDReport *rep) { in ReportDeadlock() argument
47 PrintStackTrace(thr, rep->loop[i].stk[1]); in ReportDeadlock()
51 PrintStackTrace(thr, rep->loop[i].stk[0]); in ReportDeadlock()
57 Callback::Callback(Thread *thr) in Callback() argument
58 : thr(thr) { in Callback()
59 lt = thr->dd_lt; in Callback()
60 pt = thr->dd_pt; in Callback()
64 return CurrentStackTrace(thr, 3); in Unwind()
99 void ThreadInit(Thread *thr) { in ThreadInit() argument
102 thr->dd_pt = ctx->dd->CreatePhysicalThread(); in ThreadInit()
103 thr->dd_lt = ctx->dd->CreateLogicalThread(id); in ThreadInit()
106 void ThreadDestroy(Thread *thr) { in ThreadDestroy() argument
107 ctx->dd->DestroyPhysicalThread(thr->dd_pt); in ThreadDestroy()
108 ctx->dd->DestroyLogicalThread(thr->dd_lt); in ThreadDestroy()
111 void MutexBeforeLock(Thread *thr, uptr m, bool writelock) { in MutexBeforeLock() argument
112 if (thr->ignore_interceptors) in MutexBeforeLock()
114 Callback cb(thr); in MutexBeforeLock()
121 ReportDeadlock(thr, ctx->dd->GetReport(&cb)); in MutexBeforeLock()
124 void MutexAfterLock(Thread *thr, uptr m, bool writelock, bool trylock) { in MutexAfterLock() argument
125 if (thr->ignore_interceptors) in MutexAfterLock()
127 Callback cb(thr); in MutexAfterLock()
134 ReportDeadlock(thr, ctx->dd->GetReport(&cb)); in MutexAfterLock()
137 void MutexBeforeUnlock(Thread *thr, uptr m, bool writelock) { in MutexBeforeUnlock() argument
138 if (thr->ignore_interceptors) in MutexBeforeUnlock()
140 Callback cb(thr); in MutexBeforeUnlock()
145 ReportDeadlock(thr, ctx->dd->GetReport(&cb)); in MutexBeforeUnlock()
148 void MutexDestroy(Thread *thr, uptr m) { in MutexDestroy() argument
149 if (thr->ignore_interceptors) in MutexDestroy()
151 Callback cb(thr); in MutexDestroy()