VirtualBox

Changeset 38035 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 18, 2011 4:19:51 PM (14 years ago)
Author:
vboxsync
Message:

PDMCritSectLeave: Don't leave if we're not the owner, panic instead (later, just ignore).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/PDMAllCritSect.cpp

    r37583 r38035  
    518518        return;
    519519
    520     Assert(pCritSect->s.Core.NativeThreadOwner == pdmCritSectGetNativeSelf(pCritSect));
     520    /*
     521     * Always check that the caller is the owner (screw performance).
     522     */
     523    RTNATIVETHREAD const hNativeSelf = pdmCritSectGetNativeSelf(pCritSect);
     524    if (RT_UNLIKELY(pCritSect->s.Core.NativeThreadOwner != hNativeSelf))
     525    {
     526#if 0
     527        AssertMsgFailed(("%p %s: %p != %p; cLockers=%d cNestings=%d\n", pCritSect, R3STRING(pCritSect->s.pszName),
     528                         pCritSect->s.Core.NativeThreadOwner, hNativeSelf,
     529                         pCritSect->s.Core.cLockers, pCritSect->s.Core.cNestings));
     530#else
     531        AssertReleaseMsgFailed(("%p %s: %p != %p; cLockers=%d cNestings=%d\n", pCritSect, R3STRING(pCritSect->s.pszName),
     532                                pCritSect->s.Core.NativeThreadOwner, hNativeSelf,
     533                                pCritSect->s.Core.cLockers, pCritSect->s.Core.cNestings));
     534#endif
     535        return;
     536    }
    521537    Assert(pCritSect->s.Core.cNestings >= 1);
    522538
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette