VirtualBox

Changeset 48185 in vbox for trunk/src


Ignore:
Timestamp:
Aug 30, 2013 10:10:27 AM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
88568
Message:

r0drv/solaris/timer: Implement one-shot timers the right way.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r0drv/solaris/timer-r0drv-solaris.c

    r48182 r48185  
    141141    NOREF(pvUser2);
    142142
    143     if (   pTimer->fSuspended
    144         && pTimer->interval == 0)
    145         return;
     143    /* Make sure one-shots do not fire another time. */
     144    Assert(   !pTimer->fSuspended
     145           || pTimer->interval != 0);
    146146
    147147    /* For one-shot specific timers, allow RTTimer to restart them. */
    148     /** @todo cyclic_reprogram() to CY_INFINITY? */
    149148    if (pTimer->interval == 0)
    150149        pTimer->fSuspended = true;
     
    172171    if (pTimer->pSingleTimer)
    173172    {
    174         if (   pTimer->fSuspended
    175             && pTimer->interval == 0)
    176             return;
     173        /* Make sure one-shots do not fire another time. */
     174        Assert(   !pTimer->fSuspended
     175               || pTimer->interval != 0);
    177176
    178177        /* For specific timers, we might fire on the wrong CPU between cyclic_add() and cyclic_bind().
     
    186185
    187186        /* For one-shot any-cpu timers, allow RTTimer to restart them. */
    188         /** @todo cyclic_reprogram() to CY_INFINITY? */
    189187        if (pTimer->interval == 0)
    190188            pTimer->fSuspended = true;
     
    387385        if (pTimer->interval == 0)
    388386        {
    389             /* cylic_add() comment: "The caller is responsible for assuring that cyt_when + cyt_interval <= INT64_MAX" */
    390             pSingleTimer->hFireTime.cyt_interval = INT64_MAX - pSingleTimer->hFireTime.cyt_when;
     387            /*
     388             * cylic_add() comment: "The caller is responsible for assuring that cyt_when + cyt_interval <= INT64_MAX"
     389             * but it contradicts itself because cyclic_reprogram() updates only the interval and accepts CY_INFINITY as
     390             * a valid special value. See cyclic_fire().
     391             */
     392            pSingleTimer->hFireTime.cyt_interval = CY_INFINITY;
    391393        }
    392394        else
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