- Timestamp:
- Mar 16, 2007 5:02:02 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/timer-generic.cpp
r405 r1536 1 /** $Id$ */ 1 2 /** @file 2 * InnoTek Portable Runtime - Timers, Ring-0 Driver,Generic.3 * InnoTek Portable Runtime - Timers, Generic. 3 4 */ 4 5 … … 265 266 pTimer->u64NextTS = pTimer->u64StartTS + pTimer->iTick * pTimer->u64NanoInterval; 266 267 if (pTimer->u64NextTS < u64NanoTS) 268 #ifdef IN_RING3 /* In ring-3 we'll catch up lost ticks immediately. */ 269 pTimer->u64NextTS = u64NanoTS + 1; 270 #else 267 271 pTimer->u64NextTS = u64NanoTS + RTTimerGetSystemGranularity() / 2; 272 #endif 268 273 } 269 274 270 275 /* block. */ 271 276 uint64_t cNanoSeconds = pTimer->u64NextTS - u64NanoTS; 272 int rc = RTSemEventWait(pTimer->Event, cNanoSeconds < 1000000 ? 1 : cNanoSeconds / 1000000); 273 if (RT_FAILURE(rc) && rc != VERR_INTERRUPTED && rc != VERR_TIMEOUT) 277 #ifdef IN_RING3 /* In ring-3 we'll catch up lost ticks immediately. */ 278 if (cNanoSeconds > 10) 279 #endif 274 280 { 275 AssertRC(rc); 276 RTThreadSleep(1000); /* Don't cause trouble! */ 281 int rc = RTSemEventWait(pTimer->Event, cNanoSeconds < 1000000 ? 1 : cNanoSeconds / 1000000); 282 if (RT_FAILURE(rc) && rc != VERR_INTERRUPTED && rc != VERR_TIMEOUT) 283 { 284 AssertRC(rc); 285 RTThreadSleep(1000); /* Don't cause trouble! */ 286 } 277 287 } 278 288 } … … 311 321 } 312 322 313
Note:
See TracChangeset
for help on using the changeset viewer.