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