VirtualBox

Changeset 1536 in vbox for trunk/src


Ignore:
Timestamp:
Mar 16, 2007 5:02:02 PM (18 years ago)
Author:
vboxsync
Message:

Some ring-3 adjustments.

File:
1 edited

Legend:

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

    r405 r1536  
     1/** $Id$ */
    12/** @file
    2  * InnoTek Portable Runtime - Timers, Ring-0 Driver, Generic.
     3 * InnoTek Portable Runtime - Timers, Generic.
    34 */
    45
     
    265266                pTimer->u64NextTS = pTimer->u64StartTS + pTimer->iTick * pTimer->u64NanoInterval;
    266267                if (pTimer->u64NextTS < u64NanoTS)
     268#ifdef IN_RING3 /* In ring-3 we'll catch up lost ticks immediately. */
     269                    pTimer->u64NextTS = u64NanoTS + 1;
     270#else
    267271                    pTimer->u64NextTS = u64NanoTS + RTTimerGetSystemGranularity() / 2;
     272#endif
    268273            }
    269274
    270275            /* block. */
    271276            uint64_t cNanoSeconds = pTimer->u64NextTS - u64NanoTS;
    272             int rc = RTSemEventWait(pTimer->Event, cNanoSeconds < 1000000 ? 1 : cNanoSeconds / 1000000);
    273             if (RT_FAILURE(rc) && rc != VERR_INTERRUPTED && rc != VERR_TIMEOUT)
     277#ifdef IN_RING3 /* In ring-3 we'll catch up lost ticks immediately. */
     278            if (cNanoSeconds > 10)
     279#endif
    274280            {
    275                 AssertRC(rc);
    276                 RTThreadSleep(1000); /* Don't cause trouble! */
     281                int rc = RTSemEventWait(pTimer->Event, cNanoSeconds < 1000000 ? 1 : cNanoSeconds / 1000000);
     282                if (RT_FAILURE(rc) && rc != VERR_INTERRUPTED && rc != VERR_TIMEOUT)
     283                {
     284                    AssertRC(rc);
     285                    RTThreadSleep(1000); /* Don't cause trouble! */
     286                }
    277287            }
    278288        }
     
    311321}
    312322
    313 
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