VirtualBox

Ignore:
Timestamp:
Apr 14, 2013 12:42:52 PM (12 years ago)
Author:
vboxsync
Message:

Fixed cLoops=1 retry bug and increased the loop timeout on darwin.

File:
1 edited

Legend:

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

    r45538 r45541  
    3838#include <iprt/string.h>
    3939#include <iprt/test.h>
     40#include <iprt/time.h>
    4041#include <iprt/thread.h>
    4142#ifdef VBOX
     
    6162
    6263    while (!g_fTerminate)
    63         RTThreadSleep(50);
     64    {
     65        uint64_t tsStart = RTTimeMilliTS();
     66        do
     67        {
     68            ASMNopPause();
     69        } while (RTTimeMilliTS() - tsStart < 8);
     70        RTThreadSleep(8);
     71    }
    6472
    6573    return VINF_SUCCESS;
     
    193201    }
    194202
     203
     204    RTTestSub(hTest, "Pending Preemption");
    195205RTThreadSleep(250); /** @todo fix GIP initialization? */
    196 
    197     RTTestSub(hTest, "Pending Preemption");
    198206    for (int i = 0; ; i++)
    199207    {
     
    203211        RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1,
    204212                                                 TSTR0THREADPREMEPTION_IS_PENDING, 0, &Req.Hdr), VINF_SUCCESS);
    205         if (    strcmp(Req.szMsg, "cLoops=1\n")
     213        if (    strcmp(Req.szMsg, "!cLoops=1\n")
    206214            ||  i >= 64)
    207215        {
     
    214222        if ((i % 3) == 0)
    215223            RTThreadYield();
     224        else if ((i % 16) == 0)
     225            RTThreadSleep(8);
    216226    }
    217227
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