VirtualBox

Changeset 27326 in vbox for trunk/src/VBox/Devices/PC


Ignore:
Timestamp:
Mar 12, 2010 12:34:40 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
58748
Message:

DrvACPI: Avoid poking the thread since it'll cause a default gdb config to stop the guest every time one pauses or powers down the VM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DrvACPI.cpp

    r27316 r27326  
    8484    /** true = one or more batteries preset, false = no battery present. */
    8585    bool                fBatteryPresent;
     86    /** No need to RTThreadPoke the poller when set.  */
     87    bool volatile       fDontPokePoller;
    8688    /** Remaining battery capacity. */
    8789    PDMACPIBATCAPACITY  enmBatteryRemainingCapacity;
     
    521523    while (pThread->enmState == PDMTHREADSTATE_RUNNING)
    522524    {
     525        ASMAtomicWriteBool(&pThis->fDontPokePoller, false);
     526
    523527        /*
    524528         * Read the status of the powerline-adapter.
     
    766770                                                      * PDM_ACPI_BAT_CAPACITY_MAX);
    767771            pThis->u32BatteryPresentRate =
    768                                  (uint32_t)((  (float)presentRateTotal 
     772                                 (uint32_t)((  (float)presentRateTotal
    769773                                             / (float)maxCapacityTotal) * 1000);
    770774        }
     
    772776
    773777        /* wait a bit (e.g. Ubuntu/GNOME polls every 30 seconds) */
     778        ASMAtomicWriteBool(&pThis->fDontPokePoller, true);
    774779        rc = RTSemEventWait(pThis->hPollerSleepEvent, 20000);
    775780    }
     
    783788
    784789    RTSemEventSignal(pThis->hPollerSleepEvent);
    785     RTThreadPoke(pThread->Thread);
     790    if (!ASMAtomicReadBool(&pThis->fDontPokePoller))
     791        RTThreadPoke(pThread->Thread);
    786792    return VINF_SUCCESS;
    787793}
Note: See TracChangeset for help on using the changeset viewer.

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