Changeset 25721 in vbox for trunk/src/VBox/Runtime/r3/linux
- Timestamp:
- Jan 11, 2010 2:01:53 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/linux/semmutex-linux.cpp
r25715 r25721 141 141 142 142 143 RTDECL(int) RTSemMutexDestroy(RTSEMMUTEX MutexSem)143 RTDECL(int) RTSemMutexDestroy(RTSEMMUTEX hMutexSem) 144 144 { 145 145 /* 146 146 * Validate input. 147 147 */ 148 if ( MutexSem == NIL_RTSEMMUTEX)148 if (hMutexSem == NIL_RTSEMMUTEX) 149 149 return VINF_SUCCESS; 150 struct RTSEMMUTEXINTERNAL *pThis = MutexSem;150 struct RTSEMMUTEXINTERNAL *pThis = hMutexSem; 151 151 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 152 152 AssertMsgReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, 153 (" MutexSem=%p u32Magic=%#x\n", pThis, pThis->u32Magic),153 ("hMutexSem=%p u32Magic=%#x\n", pThis, pThis->u32Magic), 154 154 VERR_INVALID_HANDLE); 155 155 … … 194 194 195 195 196 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, bool fAutoResume, PCRTLOCKVALSRCPOS pSrcPos)196 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies, bool fAutoResume, PCRTLOCKVALSRCPOS pSrcPos) 197 197 { 198 198 /* 199 199 * Validate input. 200 200 */ 201 struct RTSEMMUTEXINTERNAL *pThis = MutexSem;201 struct RTSEMMUTEXINTERNAL *pThis = hMutexSem; 202 202 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 203 203 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE); … … 343 343 344 344 #undef RTSemMutexRequest 345 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies)345 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX hMutexSem, unsigned cMillies) 346 346 { 347 347 #ifndef RTSEMMUTEX_STRICT 348 int rc = rtSemMutexRequest( MutexSem, cMillies, true, NULL);348 int rc = rtSemMutexRequest(hMutexSem, cMillies, true, NULL); 349 349 #else 350 350 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 351 int rc = rtSemMutexRequest( MutexSem, cMillies, true, &SrcPos);351 int rc = rtSemMutexRequest(hMutexSem, cMillies, true, &SrcPos); 352 352 #endif 353 353 Assert(rc != VERR_INTERRUPTED); … … 356 356 357 357 358 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)358 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 359 359 { 360 360 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 361 int rc = rtSemMutexRequest( MutexSem, cMillies, true, &SrcPos);361 int rc = rtSemMutexRequest(hMutexSem, cMillies, true, &SrcPos); 362 362 Assert(rc != VERR_INTERRUPTED); 363 363 return rc; … … 366 366 367 367 #undef RTSemMutexRequestNoResume 368 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies)368 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX hMutexSem, unsigned cMillies) 369 369 { 370 370 #ifndef RTSEMMUTEX_STRICT 371 return rtSemMutexRequest( MutexSem, cMillies, false, NULL);371 return rtSemMutexRequest(hMutexSem, cMillies, false, NULL); 372 372 #else 373 373 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_NORMAL_API(); 374 return rtSemMutexRequest( MutexSem, cMillies, false, &SrcPos);375 #endif 376 } 377 378 379 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL)374 return rtSemMutexRequest(hMutexSem, cMillies, false, &SrcPos); 375 #endif 376 } 377 378 379 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX hMutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 380 380 { 381 381 RTLOCKVALSRCPOS SrcPos = RTLOCKVALSRCPOS_INIT_DEBUG_API(); 382 return rtSemMutexRequest( MutexSem, cMillies, false, &SrcPos);383 } 384 385 386 RTDECL(int) RTSemMutexRelease(RTSEMMUTEX MutexSem)382 return rtSemMutexRequest(hMutexSem, cMillies, false, &SrcPos); 383 } 384 385 386 RTDECL(int) RTSemMutexRelease(RTSEMMUTEX hMutexSem) 387 387 { 388 388 /* 389 389 * Validate input. 390 390 */ 391 struct RTSEMMUTEXINTERNAL *pThis = MutexSem;391 struct RTSEMMUTEXINTERNAL *pThis = hMutexSem; 392 392 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 393 393 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, VERR_INVALID_HANDLE); … … 440 440 441 441 442 RTDECL(bool) RTSemMutexIsOwned(RTSEMMUTEX hMutex )442 RTDECL(bool) RTSemMutexIsOwned(RTSEMMUTEX hMutexSem) 443 443 { 444 444 /* 445 445 * Validate. 446 446 */ 447 RTSEMMUTEXINTERNAL *pThis = hMutex ;447 RTSEMMUTEXINTERNAL *pThis = hMutexSem; 448 448 AssertPtrReturn(pThis, false); 449 449 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, false);
Note:
See TracChangeset
for help on using the changeset viewer.