VirtualBox

Ignore:
Timestamp:
Sep 25, 2017 1:10:41 PM (7 years ago)
Author:
vboxsync
Message:

VMMR3EmtRendezvous: Pretend we're a single CPU config when called during vmR3Destroy after the EMTs have started terminating.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/VMEmt.cpp

    r67987 r68853  
    9494    Log(("vmR3EmulationThread: Emulation thread starting the days work... Thread=%#x pUVM=%p\n", hThreadSelf, pUVM));
    9595    VMSTATE enmBefore = VMSTATE_CREATED; /* (only used for logging atm.) */
     96    ASMAtomicIncU32(&pUVM->vm.s.cActiveEmts);
    9697    for (;;)
    9798    {
     
    244245
    245246    } /* forever */
     247
     248
     249    /*
     250     * Decrement the active EMT count if we haven't done it yet in vmR3Destroy.
     251     */
     252    if (!pUVCpu->vm.s.fBeenThruVmDestroy)
     253        ASMAtomicDecU32(&pUVM->vm.s.cActiveEmts);
    246254
    247255
     
    13811389}
    13821390
     1391
     1392/**
     1393 * Returns the number of active EMTs.
     1394 *
     1395 * This is used by the rendezvous code during VM destruction to avoid waiting
     1396 * for EMTs that aren't around any more.
     1397 *
     1398 * @returns Number of active EMTs.  0 if invalid parameter.
     1399 * @param   pUVM                The user mode VM structure.
     1400 */
     1401VMMR3_INT_DECL(uint32_t) VMR3GetActiveEmts(PUVM pUVM)
     1402{
     1403    UVM_ASSERT_VALID_EXT_RETURN(pUVM, 0);
     1404    return pUVM->vm.s.cActiveEmts;
     1405}
     1406
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