VirtualBox

Changeset 30147 in vbox for trunk/src


Ignore:
Timestamp:
Jun 10, 2010 12:11:24 PM (15 years ago)
Author:
vboxsync
Message:

AsyncCompletion: Fix race in the failsafe manager when checking the woken up flag before going to sleep. The order matters here

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDMAsyncCompletionFileFailsafe.cpp

    r30131 r30147  
    118118           || (pAioMgr->enmState == PDMACEPFILEMGRSTATE_SUSPENDING))
    119119    {
     120        ASMAtomicWriteBool(&pAioMgr->fWaitingEventSem, true);
    120121        if (!ASMAtomicReadBool(&pAioMgr->fWokenUp))
    121         {
    122             ASMAtomicWriteBool(&pAioMgr->fWaitingEventSem, true);
    123122            rc = RTSemEventWait(pAioMgr->EventSem, RT_INDEFINITE_WAIT);
    124             ASMAtomicWriteBool(&pAioMgr->fWaitingEventSem, false);
    125             AssertRC(rc);
    126         }
    127         ASMAtomicXchgBool(&pAioMgr->fWokenUp, false);
     123        ASMAtomicWriteBool(&pAioMgr->fWaitingEventSem, false);
     124        AssertRC(rc);
     125
     126        LogFlow(("Got woken up\n"));
     127        ASMAtomicWriteBool(&pAioMgr->fWokenUp, false);
    128128
    129129        /* Process endpoint events first. */
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