Changeset 27326 in vbox for trunk/src/VBox/Devices/PC
- Timestamp:
- Mar 12, 2010 12:34:40 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58748
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DrvACPI.cpp
r27316 r27326 84 84 /** true = one or more batteries preset, false = no battery present. */ 85 85 bool fBatteryPresent; 86 /** No need to RTThreadPoke the poller when set. */ 87 bool volatile fDontPokePoller; 86 88 /** Remaining battery capacity. */ 87 89 PDMACPIBATCAPACITY enmBatteryRemainingCapacity; … … 521 523 while (pThread->enmState == PDMTHREADSTATE_RUNNING) 522 524 { 525 ASMAtomicWriteBool(&pThis->fDontPokePoller, false); 526 523 527 /* 524 528 * Read the status of the powerline-adapter. … … 766 770 * PDM_ACPI_BAT_CAPACITY_MAX); 767 771 pThis->u32BatteryPresentRate = 768 (uint32_t)(( (float)presentRateTotal 772 (uint32_t)(( (float)presentRateTotal 769 773 / (float)maxCapacityTotal) * 1000); 770 774 } … … 772 776 773 777 /* wait a bit (e.g. Ubuntu/GNOME polls every 30 seconds) */ 778 ASMAtomicWriteBool(&pThis->fDontPokePoller, true); 774 779 rc = RTSemEventWait(pThis->hPollerSleepEvent, 20000); 775 780 } … … 783 788 784 789 RTSemEventSignal(pThis->hPollerSleepEvent); 785 RTThreadPoke(pThread->Thread); 790 if (!ASMAtomicReadBool(&pThis->fDontPokePoller)) 791 RTThreadPoke(pThread->Thread); 786 792 return VINF_SUCCESS; 787 793 }
Note:
See TracChangeset
for help on using the changeset viewer.