Changeset 25722 in vbox for trunk/src/VBox/Runtime/generic/semfastmutex-generic.cpp
- Timestamp:
- Jan 11, 2010 2:22:03 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/semfastmutex-generic.cpp
r21533 r25722 42 42 43 43 44 RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX p MutexSem)44 RTDECL(int) RTSemFastMutexCreate(PRTSEMFASTMUTEX phFastMtx) 45 45 { 46 46 PRTCRITSECT pCritSect = (PRTCRITSECT)RTMemAlloc(sizeof(RTCRITSECT)); 47 47 if (!pCritSect) 48 48 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); 50 52 if (RT_SUCCESS(rc)) 51 { 52 /** @todo pCritSect->fFlags |= RTCRITSECT_FLAGS_NO_NESTING; */ 53 *pMutexSem = (RTSEMFASTMUTEX)pCritSect; 54 } 53 *phFastMtx = (RTSEMFASTMUTEX)pCritSect; 55 54 else 56 55 RTMemFree(pCritSect); … … 60 59 61 60 62 RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX MutexSem)61 RTDECL(int) RTSemFastMutexDestroy(RTSEMFASTMUTEX hFastMtx) 63 62 { 64 if ( MutexSem== NIL_RTSEMFASTMUTEX)63 if (hFastMtx == NIL_RTSEMFASTMUTEX) 65 64 return VERR_INVALID_PARAMETER; 66 PRTCRITSECT pCritSect = (PRTCRITSECT) MutexSem;65 PRTCRITSECT pCritSect = (PRTCRITSECT)hFastMtx; 67 66 int rc = RTCritSectDelete(pCritSect); 68 67 if (RT_SUCCESS(rc)) … … 73 72 74 73 75 RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX MutexSem)74 RTDECL(int) RTSemFastMutexRequest(RTSEMFASTMUTEX hFastMtx) 76 75 { 77 return RTCritSectEnter((PRTCRITSECT) MutexSem);76 return RTCritSectEnter((PRTCRITSECT)hFastMtx); 78 77 } 79 78 RT_EXPORT_SYMBOL(RTSemFastMutexRequest); 80 79 81 80 82 RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX MutexSem)81 RTDECL(int) RTSemFastMutexRelease(RTSEMFASTMUTEX hFastMtx) 83 82 { 84 return RTCritSectLeave((PRTCRITSECT) MutexSem);83 return RTCritSectLeave((PRTCRITSECT)hFastMtx); 85 84 } 86 85 RT_EXPORT_SYMBOL(RTSemFastMutexRelease);
Note:
See TracChangeset
for help on using the changeset viewer.