Changeset 30111 in vbox for trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp
- Timestamp:
- Jun 9, 2010 12:14:59 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 62505
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp
r28800 r30111 341 341 DECL_FORCE_INLINE(PRTLOCKVALRECUNION) rtLockValidatorReadRecUnionPtr(PRTLOCKVALRECUNION volatile *ppRec) 342 342 { 343 PRTLOCKVALRECUNION p = (PRTLOCKVALRECUNION)ASMAtomicReadPtr((void * volatile *)ppRec);343 PRTLOCKVALRECUNION p = ASMAtomicReadPtrT(ppRec, PRTLOCKVALRECUNION); 344 344 RTLOCKVAL_ASSERT_PTR_ALIGN(p); 345 345 return p; … … 351 351 { 352 352 RTLOCKVAL_ASSERT_PTR_ALIGN(pRecNew); 353 ASMAtomicWritePtr( (void * volatile *)ppRec, pRecNew);353 ASMAtomicWritePtr(ppRec, pRecNew); 354 354 } 355 355 … … 358 358 DECL_FORCE_INLINE(PRTTHREADINT) rtLockValidatorReadThreadHandle(RTTHREAD volatile *phThread) 359 359 { 360 PRTTHREADINT p = (PRTTHREADINT)ASMAtomicReadPtr((void * volatile *)phThread);360 PRTTHREADINT p = ASMAtomicReadPtrT(phThread, PRTTHREADINT); 361 361 RTLOCKVAL_ASSERT_PTR_ALIGN(p); 362 362 return p; … … 367 367 DECL_FORCE_INLINE(PRTLOCKVALRECSHRDOWN) rtLockValidatorUoReadSharedOwner(PRTLOCKVALRECSHRDOWN volatile *ppOwner) 368 368 { 369 PRTLOCKVALRECSHRDOWN p = (PRTLOCKVALRECSHRDOWN)ASMAtomicUoReadPtr((void * volatile *)ppOwner);369 PRTLOCKVALRECSHRDOWN p = ASMAtomicUoReadPtrT(ppOwner, PRTLOCKVALRECSHRDOWN); 370 370 RTLOCKVAL_ASSERT_PTR_ALIGN(p); 371 371 return p; … … 819 819 if (pSrc) 820 820 { 821 ASMAtomicUoWriteU32(&pDst->uLine, 822 ASMAtomicUoWritePtr( (void * volatile *)&pDst->pszFile, pSrc->pszFile);823 ASMAtomicUoWritePtr( (void * volatile *)&pDst->pszFunction, pSrc->pszFunction);824 ASMAtomicUoWritePtr((void * volatile *)&pDst->uId, 821 ASMAtomicUoWriteU32(&pDst->uLine, pSrc->uLine); 822 ASMAtomicUoWritePtr(&pDst->pszFile, pSrc->pszFile); 823 ASMAtomicUoWritePtr(&pDst->pszFunction, pSrc->pszFunction); 824 ASMAtomicUoWritePtr((void * volatile *)&pDst->uId, (void *)pSrc->uId); 825 825 } 826 826 else 827 827 { 828 ASMAtomicUoWriteU32(&pDst->uLine, 829 ASMAtomicUoWritePtr( (void * volatile *)&pDst->pszFile, NULL);830 ASMAtomicUoWritePtr( (void * volatile *)&pDst->pszFunction, NULL);831 ASMAtomicUoWritePtr( (void * volatile *)&pDst->uId,0);828 ASMAtomicUoWriteU32(&pDst->uLine, 0); 829 ASMAtomicUoWritePtr(&pDst->pszFile, NULL); 830 ASMAtomicUoWritePtr(&pDst->pszFunction, NULL); 831 ASMAtomicUoWritePtr(&pDst->uId, (RTHCUINTPTR)0); 832 832 } 833 833 } … … 1359 1359 if ( !(*ppHashEntry) 1360 1360 || (*ppHashEntry)->cLookups + 128 < cLookups) 1361 ASMAtomicWritePtr( (void * volatile *)ppHashEntry, &pChunk->aRefs[i]);1361 ASMAtomicWritePtr(ppHashEntry, &pChunk->aRefs[i]); 1362 1362 1363 1363 #ifdef RTLOCKVAL_WITH_CLASS_HASH_STATS … … 1469 1469 pNew->aRefs[0].fAutodidacticism = fAutodidacticism; 1470 1470 1471 ASMAtomicWritePtr( (void * volatile *)&pChunk->pNext, pNew);1471 ASMAtomicWritePtr(&pChunk->pNext, pNew); 1472 1472 rtLockValidatorClassRetain(pPriorClass); 1473 1473 rc = VINF_SUCCESS; … … 1547 1547 if (RT_UNLIKELY(ppCoreNext)) 1548 1548 break; 1549 pSibling = (PRTLOCKVALRECUNION)ASMAtomicXchgPtr((void * volatile *)ppCoreNext, NULL);1549 pSibling = ASMAtomicXchgPtrT(ppCoreNext, NULL, PRTLOCKVALRECUNION); 1550 1550 } 1551 1551 } … … 3472 3472 { 3473 3473 PRTLOCKVALRECSHRDOWN volatile *papOwners = pRec->papOwners; 3474 ASMAtomicUoWritePtr( (void * volatile *)&pRec->papOwners, NULL);3474 ASMAtomicUoWritePtr(&pRec->papOwners, NULL); 3475 3475 ASMAtomicUoWriteU32(&pRec->cAllocated, 0); 3476 3476 … … 3815 3815 } 3816 3816 3817 ASMAtomicWritePtr( (void * volatile *)&pShared->papOwners, papOwners);3817 ASMAtomicWritePtr(&pShared->papOwners, papOwners); 3818 3818 ASMAtomicWriteU32(&pShared->cAllocated, cAllocated); 3819 3819 } … … 3858 3858 for (uint32_t iEntry = 0; iEntry < cMax; iEntry++) 3859 3859 { 3860 if (ASMAtomicCmpXchgPtr( (void * volatile *)&papOwners[iEntry], pEntry, NULL))3860 if (ASMAtomicCmpXchgPtr(&papOwners[iEntry], pEntry, NULL)) 3861 3861 { 3862 3862 rtLockValidatorSerializeDetectionLeave(); … … 3889 3889 AssertReturnVoidStmt(pShared->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, rtLockValidatorSerializeDetectionLeave()); 3890 3890 if (RT_UNLIKELY( iEntry >= pShared->cAllocated 3891 || !ASMAtomicCmpXchgPtr( (void * volatile *)&pShared->papOwners[iEntry], NULL, pEntry)))3891 || !ASMAtomicCmpXchgPtr(&pShared->papOwners[iEntry], NULL, pEntry))) 3892 3892 { 3893 3893 /* this shouldn't happen yet... */ … … 3896 3896 uint32_t const cMax = pShared->cAllocated; 3897 3897 for (iEntry = 0; iEntry < cMax; iEntry++) 3898 if (ASMAtomicCmpXchgPtr( (void * volatile *)&papOwners[iEntry], NULL, pEntry))3898 if (ASMAtomicCmpXchgPtr(&papOwners[iEntry], NULL, pEntry)) 3899 3899 break; 3900 3900 AssertReturnVoidStmt(iEntry < cMax, rtLockValidatorSerializeDetectionLeave()); … … 3931 3931 while (iEntry < cEntries) 3932 3932 { 3933 PRTLOCKVALRECSHRDOWN pEntry = (PRTLOCKVALRECSHRDOWN)ASMAtomicXchgPtr((void * volatile *)&papEntries[iEntry], NULL);3933 PRTLOCKVALRECSHRDOWN pEntry = ASMAtomicXchgPtrT(&papEntries[iEntry], NULL, PRTLOCKVALRECSHRDOWN); 3934 3934 if (pEntry) 3935 3935 {
Note:
See TracChangeset
for help on using the changeset viewer.