VirtualBox

Changeset 47552 in vbox for trunk/src/VBox/Runtime


Ignore:
Timestamp:
Aug 6, 2013 10:02:19 AM (11 years ago)
Author:
vboxsync
Message:

Runtime/timer-generic: Suspend a one shot timer before calling the timer callback or it is impossible to restart the timer from there (RTTimerStart will return VERR_TIMER_ACTIVE)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/generic/timer-generic.cpp

    r43533 r47552  
    257257            {
    258258                pTimer->iTick++;
     259
     260                /* one shot? */
     261                if (!pTimer->u64NanoInterval)
     262                    ASMAtomicXchgU8(&pTimer->fSuspended, true);
    259263                pTimer->pfnTimer(pTimer, pTimer->pvUser, pTimer->iTick);
    260264
     
    262266                if (pTimer->fSuspended || pTimer->fDestroyed)
    263267                    continue;
    264 
    265                 /* one shot? */
    266                 if (!pTimer->u64NanoInterval)
    267                 {
    268                     ASMAtomicXchgU8(&pTimer->fSuspended, true);
    269                     continue;
    270                 }
    271268
    272269                /* calc the next time we should fire. */
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