VirtualBox

Changeset 25711 in vbox for trunk/src/VBox/Runtime/r3/os2


Ignore:
Timestamp:
Jan 11, 2010 11:15:04 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56449
Message:

iprt: RTSemMutex order validation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/os2/sems-os2.cpp

    r25640 r25711  
    233233
    234234
    235 RTDECL(int)  RTSemMutexCreate(PRTSEMMUTEX pMutexSem)
    236 {
     235#undef RTSemMutexCreate
     236RTDECL(int)  RTSemMutexCreate(PRTSEMMUTEX phMutexSem)
     237{
     238    return RTSemMutexCreateEx(phMutexSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, NULL);
     239}
     240
     241
     242RTDECL(int) RTSemMutexCreateEx(PRTSEMMUTEX phMutexSem, uint32_t fFlags,
     243                               RTLOCKVALCLASS hClass, uint32_t uSubClass, const char *pszNameFmt, ...)
     244{
     245    AssertReturn(!(fFlags & ~RTSEMMUTEX_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER);
     246
    237247    /*
    238248     * Create the semaphore.
     
    242252    if (!rc)
    243253    {
    244         *pMutexSem = (RTSEMMUTEX)(void *)hmtx;
     254        /** @todo implement lock validation of OS/2 mutex semaphores. */
     255        *phMutexSem = (RTSEMMUTEX)(void *)hmtx;
    245256        return VINF_SUCCESS;
    246257    }
     
    260271    AssertMsgFailed(("Destroy MutexSem %p failed, rc=%d\n", MutexSem, rc));
    261272    return RTErrConvertFromOS2(rc);
     273}
     274
     275
     276
     277RTDECL(uint32_t) RTSemMutexSetSubClass(RTSEMMUTEX hMutexSem, uint32_t uSubClass)
     278{
     279#if 0 /** @todo def RTSEMMUTEX_STRICT */
     280    /*
     281     * Validate.
     282     */
     283    RTSEMMUTEXINTERNAL *pThis = hMutexSem;
     284    AssertPtrReturn(pThis, RTLOCKVAL_SUB_CLASS_INVALID);
     285    AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, RTLOCKVAL_SUB_CLASS_INVALID);
     286
     287    return RTLockValidatorRecExclSetSubClass(&pThis->ValidatorRec, uSubClass);
     288#else
     289    return RTLOCKVAL_SUB_CLASS_INVALID;
     290#endif
    262291}
    263292
Note: See TracChangeset for help on using the changeset viewer.

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