Changeset 38944 in vbox for trunk/src/VBox
- Timestamp:
- Oct 5, 2011 2:03:53 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp
r38081 r38944 491 491 * Leaves a critical section entered with PDMCritSectEnter(). 492 492 * 493 * @returns Indication whether we really exited the critical section. 494 * @retval VINF_SUCCESS if we really exited. 495 * @retval VINF_SEM_NESTED if we only reduced the nesting count. 496 * @retval VERR_NOT_OWNER if you somehow ignore release assertions. 497 * 493 498 * @param pCritSect The PDM critical section to leave. 494 499 */ 495 VMMDECL( void) PDMCritSectLeave(PPDMCRITSECT pCritSect)500 VMMDECL(int) PDMCritSectLeave(PPDMCRITSECT pCritSect) 496 501 { 497 502 AssertMsg(pCritSect->s.Core.u32Magic == RTCRITSECT_MAGIC, ("%p %RX32\n", pCritSect, pCritSect->s.Core.u32Magic)); … … 500 505 /* Check for NOP sections before asserting ownership. */ 501 506 if (pCritSect->s.Core.fFlags & RTCRITSECT_FLAGS_NOP) 502 return ;507 return VINF_SUCCESS; 503 508 504 509 /* … … 506 511 */ 507 512 RTNATIVETHREAD const hNativeSelf = pdmCritSectGetNativeSelf(pCritSect); 508 AssertReleaseMsgReturnVoid(pCritSect->s.Core.NativeThreadOwner == hNativeSelf, 509 ("%p %s: %p != %p; cLockers=%d cNestings=%d\n", pCritSect, R3STRING(pCritSect->s.pszName), 510 pCritSect->s.Core.NativeThreadOwner, hNativeSelf, 511 pCritSect->s.Core.cLockers, pCritSect->s.Core.cNestings)); 513 AssertReleaseMsgReturn(pCritSect->s.Core.NativeThreadOwner == hNativeSelf, 514 ("%p %s: %p != %p; cLockers=%d cNestings=%d\n", pCritSect, R3STRING(pCritSect->s.pszName), 515 pCritSect->s.Core.NativeThreadOwner, hNativeSelf, 516 pCritSect->s.Core.cLockers, pCritSect->s.Core.cNestings), 517 VERR_NOT_OWNER); 512 518 Assert(pCritSect->s.Core.cNestings >= 1); 513 519 … … 521 527 ASMAtomicDecS32(&pCritSect->s.Core.cLockers); 522 528 Assert(pCritSect->s.Core.cLockers >= 0); 523 return ;529 return VINF_SEM_NESTED; 524 530 } 525 531 … … 595 601 ASMAtomicWriteHandle(&pCritSect->s.Core.NativeThreadOwner, NIL_RTNATIVETHREAD); 596 602 if (ASMAtomicCmpXchgS32(&pCritSect->s.Core.cLockers, -1, 0)) 597 return ;603 return VINF_SUCCESS; 598 604 599 605 /* darn, someone raced in on us. */ … … 620 626 } 621 627 #endif /* IN_RING0 || IN_RC */ 628 629 return VINF_SUCCESS; 622 630 } 623 631
Note:
See TracChangeset
for help on using the changeset viewer.