Changeset 25478 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Dec 18, 2009 12:58:10 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56147
- Location:
- trunk/src/VBox/Runtime/r3/posix
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
r25467 r25478 155 155 156 156 157 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, RTSEMMUTEX_STRICT_POS_DECL)157 DECL_FORCE_INLINE(int) rtSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies, PCRTLOCKVALIDATORSRCPOS pSrcPos) 158 158 { 159 159 /* … … 166 166 #ifdef RTSEMMUTEX_STRICT 167 167 RTTHREAD hThreadSelf = RTThreadSelfAutoAdopt(); 168 RTLockValidatorCheckOrder(&pThis->ValidatorRec, hThreadSelf, RTSEMMUTEX_STRICT_POS_ARGS);168 RTLockValidatorCheckOrder(&pThis->ValidatorRec, hThreadSelf, pSrcPos); 169 169 #endif 170 170 … … 190 190 #ifdef RTSEMMUTEX_STRICT 191 191 int rc9 = RTLockValidatorCheckBlocking(&pThis->ValidatorRec, hThreadSelf, 192 RTTHREADSTATE_MUTEX, true, uId, RT_SRC_POS_ARGS);192 RTTHREADSTATE_MUTEX, true, pSrcPos); 193 193 if (RT_FAILURE(rc9)) 194 194 return rc9; 195 #e lse195 #endif 196 196 RTThreadBlocking(hThreadSelf, RTTHREADSTATE_MUTEX); 197 #endif198 197 } 199 198 … … 248 247 ASMAtomicWriteU32(&pThis->cNesting, 1); 249 248 #ifdef RTSEMMUTEX_STRICT 250 RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, RTSEMMUTEX_STRICT_POS_ARGS);249 RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, pSrcPos); 251 250 #endif 252 251 … … 258 257 { 259 258 #ifndef RTSEMMUTEX_STRICT 260 return rtSemMutexRequest(MutexSem, cMillies, RTSEMMUTEX_STRICT_POS_ARGS);259 return rtSemMutexRequest(MutexSem, cMillies, NULL); 261 260 #else 262 return RTSemMutexRequestDebug(MutexSem, cMillies, (uintptr_t)ASMReturnAddress(), RT_SRC_POS); 261 RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API(); 262 return rtSemMutexRequest(MutexSem, cMillies, &SrcPos); 263 263 #endif 264 264 } … … 267 267 RTDECL(int) RTSemMutexRequestDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 268 268 { 269 #ifdef RTSEMMUTEX_STRICT 270 return rtSemMutexRequest(MutexSem, cMillies, RTSEMMUTEX_STRICT_POS_ARGS); 269 RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API(); 270 return rtSemMutexRequest(MutexSem, cMillies, &SrcPos); 271 } 272 273 274 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies) 275 { 276 /* (EINTR isn't returned by the wait functions we're using.) */ 277 #ifndef RTSEMMUTEX_STRICT 278 return rtSemMutexRequest(MutexSem, cMillies, NULL); 271 279 #else 272 return RTSemMutexRequest(MutexSem, cMillies); 273 #endif 274 } 275 276 277 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies) 278 { 279 /* EINTR isn't returned by the wait functions we're using. */ 280 #ifndef RTSEMMUTEX_STRICT 281 return RTSemMutexRequest(MutexSem, cMillies); 282 #else 283 return RTSemMutexRequestDebug(MutexSem, cMillies, (uintptr_t)ASMReturnAddress(), RT_SRC_POS); 280 RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API(); 281 return rtSemMutexRequest(MutexSem, cMillies, &SrcPos); 284 282 #endif 285 283 } … … 288 286 RTDECL(int) RTSemMutexRequestNoResumeDebug(RTSEMMUTEX MutexSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 289 287 { 290 /* EINTR isn't returned by the wait functions we're using. */ 291 #ifdef RTSEMMUTEX_STRICT 292 return RTSemMutexRequestDebug(MutexSem, cMillies, RTSEMMUTEX_STRICT_POS_ARGS); 293 #else 294 return RTSemMutexRequest(MutexSem, cMillies); 295 #endif 288 RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API(); 289 return rtSemMutexRequest(MutexSem, cMillies, &SrcPos); 296 290 } 297 291 -
trunk/src/VBox/Runtime/r3/posix/semrw-posix.cpp
r25467 r25478 315 315 316 316 317 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW RWSem, unsigned cMillies, RTSEMRW_STRICT_POS_DECL)317 DECL_FORCE_INLINE(int) rtSemRWRequestWrite(RTSEMRW RWSem, unsigned cMillies, PCRTLOCKVALIDATORSRCPOS pSrcPos) 318 318 { 319 319 /* … … 327 327 #ifdef RTSEMRW_STRICT 328 328 RTTHREAD hThreadSelf = RTThreadSelfAutoAdopt(); 329 RTLockValidatorCheckOrder(&pThis->ValidatorRec, hThreadSelf, RTSEMRW_STRICT_POS_ARGS);329 RTLockValidatorCheckOrder(&pThis->ValidatorRec, hThreadSelf, pSrcPos); 330 330 #endif 331 331 … … 339 339 { 340 340 #ifdef RTSEMRW_STRICT 341 int rc9 = RTLockValidatorRecordRecursion(&pThis->ValidatorRec, RTSEMRW_STRICT_POS_ARGS);341 int rc9 = RTLockValidatorRecordRecursion(&pThis->ValidatorRec, pSrcPos); 342 342 if (RT_FAILURE(rc9)) 343 343 return rc9; … … 357 357 { 358 358 #ifdef RTSEMRW_STRICT 359 int rc9 = RTLockValidatorCheckBlocking(&pThis->ValidatorRec, hThreadSelf, RTTHREADSTATE_RW_WRITE, true, uId, RT_SRC_POS_ARGS);359 int rc9 = RTLockValidatorCheckBlocking(&pThis->ValidatorRec, hThreadSelf, RTTHREADSTATE_RW_WRITE, true, pSrcPos); 360 360 if (RT_FAILURE(rc9)) 361 361 return rc9; 362 #e lse362 #endif 363 363 RTThreadBlocking(hThreadSelf, RTTHREADSTATE_RW_WRITE); 364 #endif365 364 } 366 365 … … 412 411 pThis->cWrites = 1; 413 412 #ifdef RTSEMRW_STRICT 414 RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, RTSEMRW_STRICT_POS_ARGS);413 RTLockValidatorSetOwner(&pThis->ValidatorRec, hThreadSelf, pSrcPos); 415 414 #endif 416 415 return VINF_SUCCESS; … … 421 420 { 422 421 #ifndef RTSEMRW_STRICT 423 return rtSemRWRequestWrite(RWSem, cMillies, RTSEMRW_STRICT_POS_ARGS);422 return rtSemRWRequestWrite(RWSem, cMillies, NULL); 424 423 #else 425 return RTSemRWRequestWriteDebug(RWSem, cMillies, (uintptr_t)ASMReturnAddress(), RT_SRC_POS); 424 RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API(); 425 return rtSemRWRequestWrite(RWSem, cMillies, &SrcPos); 426 426 #endif 427 427 } … … 430 430 RTDECL(int) RTSemRWRequestWriteDebug(RTSEMRW RWSem, unsigned cMillies, RTHCUINTPTR uId, RT_SRC_POS_DECL) 431 431 { 432 #ifdef RTSEMRW_STRICT 433 return rtSemRWRequestWrite(RWSem, cMillies, RTSEMRW_STRICT_POS_ARGS); 434 #else 435 return RTSemRWRequestWrite(RWSem, cMillies); 436 #endif 432 RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API(); 433 return rtSemRWRequestWrite(RWSem, cMillies, &SrcPos); 437 434 } 438 435 … … 442 439 /* EINTR isn't returned by the wait functions we're using. */ 443 440 #ifndef RTSEMRW_STRICT 444 return RTSemRWRequestWrite(RWSem, cMillies);441 return rtSemRWRequestWrite(RWSem, cMillies, NULL); 445 442 #else 446 return RTSemRWRequestWriteDebug(RWSem, cMillies, (uintptr_t)ASMReturnAddress(), RT_SRC_POS); 443 RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_NORMAL_API(); 444 return rtSemRWRequestWrite(RWSem, cMillies, &SrcPos); 447 445 #endif 448 446 } … … 452 450 { 453 451 /* EINTR isn't returned by the wait functions we're using. */ 454 #ifdef RTSEMRW_STRICT 455 return RTSemRWRequestWriteDebug(RWSem, cMillies, RTSEMRW_STRICT_POS_ARGS); 456 #else 457 return RTSemRWRequestWrite(RWSem, cMillies); 458 #endif 452 RTLOCKVALIDATORSRCPOS SrcPos = RTLOCKVALIDATORSRCPOS_INIT_DEBUG_API(); 453 return rtSemRWRequestWrite(RWSem, cMillies, &SrcPos); 459 454 } 460 455
Note:
See TracChangeset
for help on using the changeset viewer.