VirtualBox

Changeset 19965 in vbox for trunk/src/VBox


Ignore:
Timestamp:
May 24, 2009 6:05:16 AM (16 years ago)
Author:
vboxsync
Message:

tstR0ThreadPreemption.cpp: Don't loop forever.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemption.cpp

    r19943 r19965  
    9898                if (ASMGetFlags() & X86_EFL_IF)
    9999                {
    100                     uint64_t    u64StartTS    = RTTimeNanoTS();
     100                    uint64_t    u64StartTS    = RTTimeSystemNanoTS();
    101101                    uint64_t    cLoops        = 0;
    102102                    uint64_t    cNanosElapsed;
     
    105105                    {
    106106                        fPending = RTThreadPreemptIsPending(NIL_RTTHREAD);
    107                         cNanosElapsed = RTTimeNanoTS() - u64StartTS;
     107                        cNanosElapsed = RTTimeSystemNanoTS() - u64StartTS;
    108108                        cLoops++;
    109109                    } while (   !fPending
    110                              && cNanosElapsed < UINT64_C(60)*1000U*1000U*1000U);
     110                             && cNanosElapsed < UINT64_C(2)*1000U*1000U*1000U
     111                             && cLoops < 10U*_1M);
    111112                    if (!fPending)
    112113                        RTStrPrintf(pszErr, cchErr, "!Preempt not pending after %'llu loops / %'llu ns",
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