VirtualBox

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


Ignore:
Timestamp:
Jan 18, 2010 10:07:28 PM (15 years ago)
Author:
vboxsync
Message:

RTSemRWIsReadOwner: For assertion in main.

File:
1 edited

Legend:

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

    r25844 r25908  
    40184018    if (!pRec->fEnabled)
    40194019        return;
    4020     AssertReturnVoid(hThread != NIL_RTTHREAD);
     4020    if (hThread == NIL_RTTHREAD)
     4021    {
     4022        hThread = RTThreadSelfAutoAdopt();
     4023        AssertReturnVoid(hThread != NIL_RTTHREAD);
     4024    }
    40214025    AssertReturnVoid(hThread->u32Magic == RTTHREADINT_MAGIC);
    40224026
     
    40434047}
    40444048RT_EXPORT_SYMBOL(RTLockValidatorRecSharedRemoveOwner);
     4049
     4050
     4051RTDECL(bool) RTLockValidatorRecSharedIsOwner(PRTLOCKVALRECSHRD pRec, RTTHREAD hThread)
     4052{
     4053    /* Validate and resolve input. */
     4054    AssertReturn(pRec->Core.u32Magic == RTLOCKVALRECSHRD_MAGIC, false);
     4055    if (!pRec->fEnabled)
     4056        return false;
     4057    if (hThread == NIL_RTTHREAD)
     4058    {
     4059        hThread = RTThreadSelfAutoAdopt();
     4060        AssertReturn(hThread != NIL_RTTHREAD, false);
     4061    }
     4062    AssertReturn(hThread->u32Magic == RTTHREADINT_MAGIC, false);
     4063
     4064    /* Do the job. */
     4065    PRTLOCKVALRECUNION pEntry = rtLockValidatorRecSharedFindOwner(pRec, hThread, NULL);
     4066    return pEntry != NULL;
     4067}
     4068RT_EXPORT_SYMBOL(RTLockValidatorRecSharedIsOwner);
    40454069
    40464070
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