Changeset 25721 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Jan 11, 2010 2:01:53 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56461
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
r25711 r25721 127 127 128 128 129 RTDECL(int) RTSemMutexDestroy(RTSEMMUTEX MutexSem)129 RTDECL(int) RTSemMutexDestroy(RTSEMMUTEX hMutexSem) 130 130 { 131 131 /* 132 132 * Validate input. 133 133 */ 134 if ( MutexSem == NIL_RTSEMMUTEX)134 if (hMutexSem == NIL_RTSEMMUTEX) 135 135 return VINF_SUCCESS; 136 struct RTSEMMUTEXINTERNAL *pThis = MutexSem;136 struct RTSEMMUTEXINTERNAL *pThis = hMutexSem; 137 137 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 138 138 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE); … … 144 144 if (rc) 145 145 { 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)); 147 147 return RTErrConvertFromErrno(rc); 148 148 } … … 180 180 181 181 182 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos)182 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies, PCRTLOCKVALSRCPOS pSrcPos) 183 183 { 184 184 /* 185 185 * Validate input. 186 186 */ 187 struct RTSEMMUTEXINTERNAL *pThis = MutexSem;187 struct RTSEMMUTEXINTERNAL *pThis = hMutexSem; 188 188 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 189 189 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE); … … 230 230 if (rc) 231 231 { 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); 233 233 return RTErrConvertFromErrno(rc); 234 234 } … … 261 261 if (rc) 262 262 { 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); 264 264 return RTErrConvertFromErrno(rc); 265 265 } … … 281 281 282 282 #undef RTSemMutexRequest 283 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies)283 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies) 284 284 { 285 285 #ifndef RTSEMMUTEX_STRICT 286 return rtSemMutexRequest( MutexSem, cMillies, NULL);286 return rtSemMutexRequest(hMutexSem, cMillies, NULL); 287 287 #else 288 288 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 294 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 295 295 { 296 296 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 297 return rtSemMutexRequest( MutexSem, cMillies, &SrcPos);297 return rtSemMutexRequest(hMutexSem, cMillies, &SrcPos); 298 298 } 299 299 300 300 301 301 #undef RTSemMutexRequestNoResume 302 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies)302 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies) 303 303 { 304 304 /* (EINTR isn't returned by the wait functions we're using.) */ 305 305 #ifndef RTSEMMUTEX_STRICT 306 return rtSemMutexRequest( MutexSem, cMillies, NULL);306 return rtSemMutexRequest(hMutexSem, cMillies, NULL); 307 307 #else 308 308 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 314 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 315 315 { 316 316 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 321 RTDECL(int) RTSemMutexRelease(RTSEMMUTEX hMutexSem) 322 322 { 323 323 /* 324 324 * Validate input. 325 325 */ 326 struct RTSEMMUTEXINTERNAL *pThis = MutexSem;326 struct RTSEMMUTEXINTERNAL *pThis = hMutexSem; 327 327 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 328 328 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE); … … 367 367 if (RT_UNLIKELY(rc)) 368 368 { 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); 370 370 return RTErrConvertFromErrno(rc); 371 371 } … … 375 375 376 376 377 RTDECL(bool) RTSemMutexIsOwned(RTSEMMUTEX hMutex )377 RTDECL(bool) RTSemMutexIsOwned(RTSEMMUTEX hMutexSem) 378 378 { 379 379 /* 380 380 * Validate. 381 381 */ 382 RTSEMMUTEXINTERNAL *pThis = hMutex ;382 RTSEMMUTEXINTERNAL *pThis = hMutexSem; 383 383 AssertPtrReturn(pThis, false); 384 384 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, false);
Note:
See TracChangeset
for help on using the changeset viewer.