VirtualBox

Ignore:
Timestamp:
Jan 11, 2010 2:22:03 PM (15 years ago)
Author:
vboxsync
Message:

iprt/RTSemFastMutex: A little cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/semfastmutex-generic.cpp

    r21533 r25722  
    4242
    4343
    44 RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX pMutexSem)
     44RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFastMtx)
    4545{
    4646    PRTCRITSECT pCritSect = (PRTCRITSECT)RTMemAlloc(sizeof(RTCRITSECT));
    4747    if (!pCritSect)
    4848        return VERR_NO_MEMORY;
    49     int rc = RTCritSectInit(pCritSect);
     49
     50    int rc = RTCritSectInitEx(pCritSect, RTCRITSECT_FLAGS_NO_NESTING,
     51                              NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, NULL);
    5052    if (RT_SUCCESS(rc))
    51     {
    52         /** @todo pCritSect->fFlags |= RTCRITSECT_FLAGS_NO_NESTING; */
    53         *pMutexSem = (RTSEMFASTMUTEX)pCritSect;
    54     }
     53        *phFastMtx = (RTSEMFASTMUTEX)pCritSect;
    5554    else
    5655        RTMemFree(pCritSect);
     
    6059
    6160
    62 RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX MutexSem)
     61RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFastMtx)
    6362{
    64     if (MutexSem == NIL_RTSEMFASTMUTEX)
     63    if (hFastMtx == NIL_RTSEMFASTMUTEX)
    6564        return VERR_INVALID_PARAMETER;
    66     PRTCRITSECT pCritSect = (PRTCRITSECT)MutexSem;
     65    PRTCRITSECT pCritSect = (PRTCRITSECT)hFastMtx;
    6766    int rc = RTCritSectDelete(pCritSect);
    6867    if (RT_SUCCESS(rc))
     
    7372
    7473
    75 RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX MutexSem)
     74RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFastMtx)
    7675{
    77     return RTCritSectEnter((PRTCRITSECT)MutexSem);
     76    return RTCritSectEnter((PRTCRITSECT)hFastMtx);
    7877}
    7978RT_EXPORT_SYMBOL(RTSemFastMutexRequest);
    8079
    8180
    82 RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX MutexSem)
     81RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFastMtx)
    8382{
    84     return RTCritSectLeave((PRTCRITSECT)MutexSem);
     83    return RTCritSectLeave((PRTCRITSECT)hFastMtx);
    8584}
    8685RT_EXPORT_SYMBOL(RTSemFastMutexRelease);
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