Changeset 45541 in vbox for trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemptionDriver.cpp
- Timestamp:
- Apr 14, 2013 12:42:52 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemptionDriver.cpp
r45538 r45541 38 38 #include <iprt/string.h> 39 39 #include <iprt/test.h> 40 #include <iprt/time.h> 40 41 #include <iprt/thread.h> 41 42 #ifdef VBOX … … 61 62 62 63 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 } 64 72 65 73 return VINF_SUCCESS; … … 193 201 } 194 202 203 204 RTTestSub(hTest, "Pending Preemption"); 195 205 RTThreadSleep(250); /** @todo fix GIP initialization? */ 196 197 RTTestSub(hTest, "Pending Preemption");198 206 for (int i = 0; ; i++) 199 207 { … … 203 211 RTTESTI_CHECK_RC(rc = SUPR3CallR0Service("tstR0ThreadPreemption", sizeof("tstR0ThreadPreemption") - 1, 204 212 TSTR0THREADPREMEPTION_IS_PENDING, 0, &Req.Hdr), VINF_SUCCESS); 205 if ( strcmp(Req.szMsg, " cLoops=1\n")213 if ( strcmp(Req.szMsg, "!cLoops=1\n") 206 214 || i >= 64) 207 215 { … … 214 222 if ((i % 3) == 0) 215 223 RTThreadYield(); 224 else if ((i % 16) == 0) 225 RTThreadSleep(8); 216 226 } 217 227
Note:
See TracChangeset
for help on using the changeset viewer.