VirtualBox

Changeset 25707 in vbox for trunk/src/VBox/Runtime/common


Ignore:
Timestamp:
Jan 11, 2010 10:02:03 AM (15 years ago)
Author:
vboxsync
Message:

iprt: Added RTSemRWCreateEx and RTSemRWSetSubClass. Updated tstRTLockValidator with a test of the SemRW lock order validation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/lockvalidator.cpp

    r25704 r25707  
    28072807    RTLOCKVAL_ASSERT_PTR_ALIGN(pRec);
    28082808    RTLOCKVAL_ASSERT_PTR_ALIGN(hLock);
     2809    Assert(   uSubClass >= RTLOCKVAL_SUB_CLASS_USER
     2810           || uSubClass == RTLOCKVAL_SUB_CLASS_NONE
     2811           || uSubClass == RTLOCKVAL_SUB_CLASS_ANY);
    28092812
    28102813    pRec->Core.u32Magic = RTLOCKVALRECEXCL_MAGIC;
     
    32293232    RTLOCKVAL_ASSERT_PTR_ALIGN(pRec);
    32303233    RTLOCKVAL_ASSERT_PTR_ALIGN(hLock);
     3234    Assert(   uSubClass >= RTLOCKVAL_SUB_CLASS_USER
     3235           || uSubClass == RTLOCKVAL_SUB_CLASS_NONE
     3236           || uSubClass == RTLOCKVAL_SUB_CLASS_ANY);
    32313237
    32323238    pRec->Core.u32Magic = RTLOCKVALRECSHRD_MAGIC;
     
    33013307
    33023308    rtLockValidatorSerializeDestructLeave();
     3309}
     3310
     3311
     3312RTDECL(uint32_t) RTLockValidatorRecSharedSetSubClass(PRTLOCKVALRECSHRD pRec, uint32_t uSubClass)
     3313{
     3314    AssertPtrReturn(pRec, RTLOCKVAL_SUB_CLASS_INVALID);
     3315    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, RTLOCKVAL_SUB_CLASS_INVALID);
     3316    AssertReturn(   uSubClass >= RTLOCKVAL_SUB_CLASS_USER
     3317                 || uSubClass == RTLOCKVAL_SUB_CLASS_NONE
     3318                 || uSubClass == RTLOCKVAL_SUB_CLASS_ANY,
     3319                 RTLOCKVAL_SUB_CLASS_INVALID);
     3320    return ASMAtomicXchgU32(&pRec->uSubClass, uSubClass);
    33033321}
    33043322
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette