VirtualBox

Changeset 2828 in vbox


Ignore:
Timestamp:
May 23, 2007 4:20:24 PM (18 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
21443
Message:

If the TSC isn't fixed, spin instead of sleeping when reading out the the TSC frequency.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/TM.cpp

    r2827 r2828  
    570570        else
    571571        {
    572             RTThreadSleep(32);              /* To preserve old behaviour and to get a good CpuHz at startup. */
     572            if (tmR3HasFixedTSC())
     573                /* Sleep a bit to get a more reliable CpuHz value. */
     574                RTThreadSleep(32);             
     575            else
     576            {
     577                /* Spin for 40ms to try push up the CPU frequency and get a more reliable CpuHz value. */
     578                const uint64_t u64 = RTTimeMilliTS();
     579                while ((RTTimeMilliTS() - u64) < 40 /*ms*/)
     580                    /* nothing */;
     581            }
     582
    573583            pGip = g_pSUPGlobalInfoPage;
    574584            if (    pGip
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