VirtualBox

Changeset 25721 in vbox for trunk/src/VBox/Runtime/r3/posix


Ignore:
Timestamp:
Jan 11, 2010 2:01:53 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
56461
Message:

iprt/RTSemMutex: MutexSem -> hMutexSem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp

    r25711 r25721  
    127127
    128128
    129 RTDECL(int)  RTSemMutexDestroy(RTSEMMUTEX MutexSem)
     129RTDECL(int)  RTSemMutexDestroy(RTSEMMUTEX hMutexSem)
    130130{
    131131    /*
    132132     * Validate input.
    133133     */
    134     if (MutexSem == NIL_RTSEMMUTEX)
     134    if (hMutexSem == NIL_RTSEMMUTEX)
    135135        return VINF_SUCCESS;
    136     struct RTSEMMUTEXINTERNAL *pThis = MutexSem;
     136    struct RTSEMMUTEXINTERNAL *pThis = hMutexSem;
    137137    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    138138    AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE);
     
    144144    if (rc)
    145145    {
    146         AssertMsgFailed(("Failed to destroy mutex sem %p, rc=%d.\n", MutexSem, rc));
     146        AssertMsgFailed(("Failed to destroy mutex sem %p, rc=%d.\n", hMutexSem, rc));
    147147        return RTErrConvertFromErrno(rc);
    148148    }
     
    180180
    181181
    182 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)
     182DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)
    183183{
    184184    /*
    185185     * Validate input.
    186186     */
    187     struct RTSEMMUTEXINTERNAL *pThis = MutexSem;
     187    struct RTSEMMUTEXINTERNAL *pThis = hMutexSem;
    188188    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    189189    AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE);
     
    230230        if (rc)
    231231        {
    232             AssertMsgFailed(("Failed to lock mutex sem %p, rc=%d.\n", MutexSem, rc)); NOREF(rc);
     232            AssertMsgFailed(("Failed to lock mutex sem %p, rc=%d.\n", hMutexSem, rc)); NOREF(rc);
    233233            return RTErrConvertFromErrno(rc);
    234234        }
     
    261261        if (rc)
    262262        {
    263             AssertMsg(rc == ETIMEDOUT, ("Failed to lock mutex sem %p, rc=%d.\n", MutexSem, rc)); NOREF(rc);
     263            AssertMsg(rc == ETIMEDOUT, ("Failed to lock mutex sem %p, rc=%d.\n", hMutexSem, rc)); NOREF(rc);
    264264            return RTErrConvertFromErrno(rc);
    265265        }
     
    281281
    282282#undef RTSemMutexRequest
    283 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies)
     283RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies)
    284284{
    285285#ifndef RTSEMMUTEX_STRICT
    286     return rtSemMutexRequest(MutexSem, cMillies, NULL);
     286    return rtSemMutexRequest(hMutexSem, cMillies, NULL);
    287287#else
    288288    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    289     return rtSemMutexRequest(MutexSem, cMillies, &SrcPos);
    290 #endif
    291 }
    292 
    293 
    294 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     289    return rtSemMutexRequest(hMutexSem, cMillies, &SrcPos);
     290#endif
     291}
     292
     293
     294RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    295295{
    296296    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    297     return rtSemMutexRequest(MutexSem, cMillies, &SrcPos);
     297    return rtSemMutexRequest(hMutexSem, cMillies, &SrcPos);
    298298}
    299299
    300300
    301301#undef RTSemMutexRequestNoResume
    302 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies)
     302RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies)
    303303{
    304304    /* (EINTR isn't returned by the wait functions we're using.) */
    305305#ifndef RTSEMMUTEX_STRICT
    306     return rtSemMutexRequest(MutexSem, cMillies, NULL);
     306    return rtSemMutexRequest(hMutexSem, cMillies, NULL);
    307307#else
    308308    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API();
    309     return rtSemMutexRequest(MutexSem, cMillies, &SrcPos);
    310 #endif
    311 }
    312 
    313 
    314 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
     309    return rtSemMutexRequest(hMutexSem, cMillies, &SrcPos);
     310#endif
     311}
     312
     313
     314RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)
    315315{
    316316    RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API();
    317     return rtSemMutexRequest(MutexSem, cMillies, &SrcPos);
    318 }
    319 
    320 
    321 RTDECL(int)  RTSemMutexRelease(RTSEMMUTEX MutexSem)
     317    return rtSemMutexRequest(hMutexSem, cMillies, &SrcPos);
     318}
     319
     320
     321RTDECL(int)  RTSemMutexRelease(RTSEMMUTEX hMutexSem)
    322322{
    323323    /*
    324324     * Validate input.
    325325     */
    326     struct RTSEMMUTEXINTERNAL *pThis = MutexSem;
     326    struct RTSEMMUTEXINTERNAL *pThis = hMutexSem;
    327327    AssertPtrReturn(pThis, VERR_INVALID_HANDLE);
    328328    AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE);
     
    367367    if (RT_UNLIKELY(rc))
    368368    {
    369         AssertMsgFailed(("Failed to unlock mutex sem %p, rc=%d.\n", MutexSem, rc)); NOREF(rc);
     369        AssertMsgFailed(("Failed to unlock mutex sem %p, rc=%d.\n", hMutexSem, rc)); NOREF(rc);
    370370        return RTErrConvertFromErrno(rc);
    371371    }
     
    375375
    376376
    377 RTDECL(bool) RTSemMutexIsOwned(RTSEMMUTEX hMutex)
     377RTDECL(bool) RTSemMutexIsOwned(RTSEMMUTEX hMutexSem)
    378378{
    379379    /*
    380380     * Validate.
    381381     */
    382     RTSEMMUTEXINTERNAL *pThis = hMutex;
     382    RTSEMMUTEXINTERNAL *pThis = hMutexSem;
    383383    AssertPtrReturn(pThis, false);
    384384    AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, false);
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