Changeset 45541 in vbox for trunk/src/VBox/Runtime/testcase
- Timestamp:
- Apr 14, 2013 12:42:52 PM (12 years ago)
- Location:
- trunk/src/VBox/Runtime/testcase
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstR0ThreadPreemption.cpp
r45539 r45541 103 103 if (!RTThreadPreemptIsEnabled(NIL_RTTHREAD)) 104 104 { 105 #ifdef RT_OS_DARWIN 106 uint64_t const cNsMax = UINT64_C(8)*1000U*1000U*1000U; 107 #else 108 uint64_t const cNsMax = UINT64_C(2)*1000U*1000U*1000U; 109 #endif 105 110 if (ASMIntAreEnabled()) 106 111 { … … 118 123 cLoops++; 119 124 } while ( !fPending 120 && cNanosElapsed < UINT64_C(2)*1000U*1000U*1000U121 && cNanosSysElapsed < UINT64_C(2)*1000U*1000U*1000U125 && cNanosElapsed < cNsMax 126 && cNanosSysElapsed < cNsMax 122 127 && cLoops < 100U*_1M); 123 128 if (!fPending) -
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.