Lines Matching refs:pThreadSelf

761  * @param   pThreadSelf         The calling thread.
766 static void rtLockValComplainFirst(const char *pszWhat, PCRTLOCKVALSRCPOS pSrcPos, PRTTHREADINT pThreadSelf,
774 RTAssertMsg2Weak("%s [uId=%p thrd=%s]\n", pszWhat, pSrcPos->uId, VALID_PTR(pThreadSelf) ? pThreadSelf->szName : "<NIL>");
776 RTAssertMsg2Weak("%s [thrd=%s]\n", pszWhat, VALID_PTR(pThreadSelf) ? pThreadSelf->szName : "<NIL>");
779 rtLockValComplainAboutLockStack(pThreadSelf, 0, 1, pRec);
1854 * @param pThreadSelf The current thread.
1857 static bool rtLockValidatorStackContainsRec(PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION pRec)
1859 PRTLOCKVALRECUNION pCur = pThreadSelf->LockValidator.pStackTop;
1894 * @param pThreadSelf The current thread.
1897 static void rtLockValidatorStackPush(PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION pRec)
1899 Assert(pThreadSelf == RTThreadSelf());
1900 Assert(!rtLockValidatorStackContainsRec(pThreadSelf, pRec));
1907 rtLockValidatorWriteRecUnionPtr(&pRec->Excl.pDown, pThreadSelf->LockValidator.pStackTop);
1913 rtLockValidatorWriteRecUnionPtr(&pRec->ShrdOwner.pDown, pThreadSelf->LockValidator.pStackTop);
1919 rtLockValidatorWriteRecUnionPtr(&pThreadSelf->LockValidator.pStackTop, pRec);
1926 * @param pThreadSelf The current thread.
1929 static void rtLockValidatorStackPop(PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION pRec)
1931 Assert(pThreadSelf == RTThreadSelf());
1951 if (pThreadSelf->LockValidator.pStackTop == pRec)
1952 rtLockValidatorWriteRecUnionPtr(&pThreadSelf->LockValidator.pStackTop, pDown);
1956 PRTLOCKVALRECUNION pCur = pThreadSelf->LockValidator.pStackTop;
1987 AssertMsgFailed(("%p %p\n", pRec, pThreadSelf));
1995 * @param pThreadSelf The current thread.
1999 static void rtLockValidatorStackPushRecursion(PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION pRec, PCRTLOCKVALSRCPOS pSrcPos)
2001 Assert(pThreadSelf == RTThreadSelf());
2002 Assert(rtLockValidatorStackContainsRec(pThreadSelf, pRec));
2008 PRTLOCKVALRECNEST pRecursionRec = pThreadSelf->LockValidator.pFreeNestRecs;
2010 pThreadSelf->LockValidator.pFreeNestRecs = pRecursionRec->pNextFree;
2048 pRecursionRec->pDown = pThreadSelf->LockValidator.pStackTop;
2049 rtLockValidatorWriteRecUnionPtr(&pThreadSelf->LockValidator.pStackTop, (PRTLOCKVALRECUNION)pRecursionRec);
2057 * @param pThreadSelf The current thread.
2060 static void rtLockValidatorStackPopRecursion(PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION pRec)
2062 Assert(pThreadSelf == RTThreadSelf());
2063 Assert(rtLockValidatorStackContainsRec(pThreadSelf, pRec));
2078 PRTLOCKVALRECUNION pNest = pThreadSelf->LockValidator.pStackTop;
2085 rtLockValidatorWriteRecUnionPtr(&pThreadSelf->LockValidator.pStackTop, pNest->Nest.pDown);
2093 AssertMsgReturnVoid(pNest, ("%p %p\n", pRec, pThreadSelf));
2126 pNest->Nest.pNextFree = pThreadSelf->LockValidator.pFreeNestRecs;
2127 pThreadSelf->LockValidator.pFreeNestRecs = &pNest->Nest;
2136 static int rtLockValidatorStackWrongOrder(const char *pszWhat, PCRTLOCKVALSRCPOS pSrcPos, PRTTHREADINT pThreadSelf,
2142 rtLockValComplainFirst(pszWhat, pSrcPos, pThreadSelf, pRec1, false);
2146 rtLockValComplainAboutLockStack(pThreadSelf, 0, 0, pRec2);
2206 * @param pThreadSelf The current thread.
2211 PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION const pRec,
2222 return rtLockValidatorStackWrongOrder("Wrong locking order!", pSrcPos, pThreadSelf,
2225 return rtLockValidatorStackWrongOrder("Wrong locking order! (unknown)", pSrcPos, pThreadSelf,
2253 return rtLockValidatorStackWrongOrder("Wrong locking order! (more than one)", pSrcPos, pThreadSelf,
2270 return rtLockValidatorStackWrongOrder("Wrong locking order! (race)", pSrcPos, pThreadSelf,
2306 return rtLockValidatorStackWrongOrder("Wrong locking order! (2nd)", pSrcPos, pThreadSelf,
2360 * @param pThreadSelf The current thread.
2365 PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION const pRec,
2373 AssertPtr(pThreadSelf);
2374 Assert(pThreadSelf->u32Magic == RTTHREADINT_MAGIC);
2381 PRTLOCKVALRECUNION pCur = pThreadSelf->LockValidator.pStackTop;
2401 return rtLockValidatorStackCheckLockingOrder2(pClass, uSubClass, pThreadSelf, pRec, pSrcPos,
2418 * @param pThreadSelf The current thread.
2421 static int rtLockValidatorStackCheckReleaseOrder(PRTTHREADINT pThreadSelf, PRTLOCKVALRECUNION pRec)
2423 AssertReturn(pThreadSelf != NIL_RTTHREAD, VERR_SEM_LV_INVALID_PARAMETER);
2424 Assert(pThreadSelf == RTThreadSelf());
2426 PRTLOCKVALRECUNION pTop = pThreadSelf->LockValidator.pStackTop;
2455 rtLockValComplainFirst("Wrong release order!", NULL, pThreadSelf, pRec, true);
2466 * @param pThreadSelf The current thread.
2468 DECL_FORCE_INLINE(bool) rtLockValidatorDdAreAllThreadsBlocked(PRTLOCKVALRECSHRD pRec, PRTTHREADINT pThreadSelf)
2488 && pCurThread != pThreadSelf)
2509 * @param pThreadSelf The current thread.
2511 static int rtLockValidatorDdVerifyDeadlock(PRTLOCKVALDDSTACK pStack, PRTTHREADINT pThreadSelf)
2529 && !rtLockValidatorDdAreAllThreadsBlocked(&pRec->Shared, pThreadSelf))
2580 * @param pThreadSelf The calling thread.
2583 PRTTHREADINT const pThreadSelf)
2617 && pNextThread != pThreadSelf)
2665 || rtLockValidatorDdAreAllThreadsBlocked(&pRec->Shared, pThreadSelf)
2686 && pNextThread != pThreadSelf)
2742 if (RT_UNLIKELY( pNextThread == pThreadSelf
2748 return rtLockValidatorDdVerifyDeadlock(pStack, pThreadSelf);
2839 * @param pThreadSelf This thread.
2844 PRTTHREADINT pThreadSelf, PCRTLOCKVALSRCPOS pSrcPos, int rc)
2856 rtLockValComplainFirst(pszWhat, pSrcPos, pThreadSelf, pStack->a[0].pRec != pRec ? pRec : NULL, true);
2894 * @param pThreadSelf The current thread.
2897 static int rtLockValidatorDeadlockDetection(PRTLOCKVALRECUNION pRec, PRTTHREADINT pThreadSelf, PCRTLOCKVALSRCPOS pSrcPos)
2900 int rc = rtLockValidatorDdDoDetection(&Stack, pRec, pThreadSelf);
2908 rc = rtLockValidatorDdDoDetection(&Stack, pRec, pThreadSelf);
2919 rcLockValidatorDoDeadlockComplaining(&Stack, pRec, pThreadSelf, pSrcPos, rc);
3315 PRTTHREADINT pThreadSelf = hThreadSelf;
3316 AssertPtrReturn(pThreadSelf, VERR_SEM_LV_INVALID_PARAMETER);
3317 AssertReturn(pThreadSelf->u32Magic == RTTHREADINT_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
3318 Assert(pThreadSelf == RTThreadSelf());
3322 RTTHREADSTATE enmThreadState = rtThreadGetState(pThreadSelf);
3334 rtLockValidatorWriteRecUnionPtr(&pThreadSelf->LockValidator.pRec, pRecU);
3335 rtLockValidatorSrcPosCopy(&pThreadSelf->LockValidator.SrcPos, pSrcPos);
3336 ASMAtomicWriteBool(&pThreadSelf->LockValidator.fInValidator, true);
3337 pThreadSelf->LockValidator.enmRecState = enmSleepState;
3338 rtThreadSetState(pThreadSelf, enmSleepState);
3347 if (rtLockValidatorReadThreadHandle(&pRecU->Excl.hThread) == pThreadSelf)
3353 rtLockValComplainFirst("Recursion not allowed!", pSrcPos, pThreadSelf, pRecU, true);
3366 rc = rtLockValidatorDeadlockDetection(pRecU, pThreadSelf, pSrcPos);
3369 ASMAtomicWriteBool(&pThreadSelf->fReallySleeping, fReallySleeping);
3372 rtThreadSetState(pThreadSelf, enmThreadState);
3373 rtLockValidatorWriteRecUnionPtr(&pThreadSelf->LockValidator.pRec, NULL);
3375 ASMAtomicWriteBool(&pThreadSelf->LockValidator.fInValidator, false);
3613 PRTTHREADINT pThreadSelf = hThreadSelf;
3614 AssertPtrReturn(pThreadSelf, VERR_SEM_LV_INVALID_PARAMETER);
3615 AssertReturn(pThreadSelf->u32Magic == RTTHREADINT_MAGIC, VERR_SEM_LV_INVALID_PARAMETER);
3616 Assert(pThreadSelf == RTThreadSelf());
3620 RTTHREADSTATE enmThreadState = rtThreadGetState(pThreadSelf);
3632 rtLockValidatorWriteRecUnionPtr(&pThreadSelf->LockValidator.pRec, pRecU);
3633 rtLockValidatorSrcPosCopy(&pThreadSelf->LockValidator.SrcPos, pSrcPos);
3634 ASMAtomicWriteBool(&pThreadSelf->LockValidator.fInValidator, true);
3635 pThreadSelf->LockValidator.enmRecState = enmSleepState;
3636 rtThreadSetState(pThreadSelf, enmSleepState);
3643 ? rtLockValidatorRecSharedFindOwner(&pRecU->Shared, pThreadSelf, NULL)
3652 rtLockValComplainFirst("Recursion not allowed!", pSrcPos, pThreadSelf, pRecU, true);
3665 rc = rtLockValidatorDeadlockDetection(pRecU, pThreadSelf, pSrcPos);
3668 ASMAtomicWriteBool(&pThreadSelf->fReallySleeping, fReallySleeping);
3671 rtThreadSetState(pThreadSelf, enmThreadState);
3672 rtLockValidatorWriteRecUnionPtr(&pThreadSelf->LockValidator.pRec, NULL);
3674 ASMAtomicWriteBool(&pThreadSelf->LockValidator.fInValidator, false);
3698 * @param pThreadSelf The calling thread and owner. Used for record
3703 rtLockValidatorRecSharedAllocOwner(PRTLOCKVALRECSHRD pRec, PRTTHREADINT pThreadSelf, PCRTLOCKVALSRCPOS pSrcPos)
3711 unsigned iEntry = ASMBitFirstSetU32(ASMAtomicUoReadU32(&pThreadSelf->LockValidator.bmFreeShrdOwners));
3713 && ASMAtomicBitTestAndClear(&pThreadSelf->LockValidator.bmFreeShrdOwners, iEntry - 1))
3715 pEntry = (PRTLOCKVALRECUNION)&pThreadSelf->LockValidator.aShrdOwners[iEntry - 1];
3718 rtThreadGet(pThreadSelf);
3731 pEntry->ShrdOwner.hThread = pThreadSelf;