VirtualBox

Changeset 24530 in vbox


Ignore:
Timestamp:
Nov 9, 2009 11:16:52 PM (15 years ago)
Author:
vboxsync
Message:

AsyncCompletion: Fix assertion when closing endpoints

File:
1 edited

Legend:

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

    r24358 r24530  
    681681            AssertMsg(VALID_PTR(pEndpointClose), ("Close endpoint event without a endpoint to close\n"));
    682682
    683             LogFlowFunc((": Closing endpoint %#p{%s}\n", pEndpointClose, pEndpointClose->Core.pszUri));
    684 
    685             /* Make sure all tasks finished. Process the queues a last time first. */
    686             rc = pdmacFileAioMgrNormalQueueReqs(pAioMgr, pEndpointClose);
    687             AssertRC(rc);
    688 
    689             pEndpointClose->enmState = PDMASYNCCOMPLETIONENDPOINTFILESTATE_CLOSING;
    690             fNotifyWaiter = !pdmacFileAioMgrNormalRemoveEndpoint(pEndpointClose);
     683            if (pEndpointClose->enmState == PDMASYNCCOMPLETIONENDPOINTFILESTATE_ACTIVE)
     684            {
     685                LogFlowFunc((": Closing endpoint %#p{%s}\n", pEndpointClose, pEndpointClose->Core.pszUri));
     686
     687                /* Make sure all tasks finished. Process the queues a last time first. */
     688                rc = pdmacFileAioMgrNormalQueueReqs(pAioMgr, pEndpointClose);
     689                AssertRC(rc);
     690
     691                pEndpointClose->enmState = PDMASYNCCOMPLETIONENDPOINTFILESTATE_CLOSING;
     692                fNotifyWaiter = !pdmacFileAioMgrNormalRemoveEndpoint(pEndpointClose);
     693            }
     694            else if (   (pEndpointClose->enmState == PDMASYNCCOMPLETIONENDPOINTFILESTATE_CLOSING)
     695                     && (!pEndpointClose->AioMgr.cRequestsActive))
     696                fNotifyWaiter = true;
    691697            break;
    692698        }
     
    770776                LogFlow(("Signalling waiter\n"));
    771777                rc = RTSemEventSignal(pAioMgr->EventSemBlock);
    772                 AssertRC(rc);   
     778                AssertRC(rc);
    773779            }
    774780        }
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