Changeset 21933 for trunk/src/winmm/os2timer.cpp
- Timestamp:
- Dec 30, 2011, 11:41:30 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/winmm/os2timer.cpp
r21930 r21933 423 423 ULONG Count = 0; 424 424 APIRET rc = 0; /* Return code */ 425 USHORT selTIB;426 425 427 426 dprintf(("WINMM: TimerHandler thread created (%08xh)\n", 428 427 this)); 429 428 430 rc = DosSetPriority (PRTYS_THREAD, /* Change a single thread */ 431 PRTYC_TIMECRITICAL, /* Time critical class */ 432 0L, /* Increase by 15 */ 433 0L); /* Assume current thread */ 429 // save the current thread priority 430 PTIB ptib = NULL; 431 DosGetInfoBlocks(&ptib, NULL); 432 ULONG prio = ptib->tib_ptib2->tib2_ulpri; 433 434 // increase the thread priority to improve timer resolution 435 DosSetPriority (PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0); 434 436 435 437 while(!fFatal) … … 438 440 dwFlags, 439 441 clientCallback)); 440 442 441 443 rc = DosWaitEventSem(TimerSem, SEM_INDEFINITE_WAIT); 442 444 if(rc) { … … 451 453 if(!fFatal) 452 454 { 453 // @@@PH: we're calling the client with PRTYC_TIMECRITICAL !!!454 // It'd be much nicer to call with original priority!455 456 455 // check timer running condition 457 456 if (TimerStatus == Running) … … 467 466 if (clientCallback != NULL) 468 467 { 468 // restore the original priority (we never know what the callback 469 // code does) 470 DosSetPriority (PRTYS_THREAD, (prio >> 8) & 0xFF, 0, 0); 471 469 472 clientCallback((UINT)timerID, 0, userData, 0, 0); 473 474 DosSetPriority (PRTYS_THREAD, PRTYC_TIMECRITICAL, 0, 0); 470 475 } 471 476 break;
Note:
See TracChangeset
for help on using the changeset viewer.