Changeset 14922
- Timestamp:
- Oct 1, 2000, 11:16:29 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified tags/trunk/src/winmm/os2timer.cpp ¶
r14177 r14922 1 /* $Id: os2timer.cpp,v 1.1 5 2000-05-24 01:56:25phaller Exp $ */1 /* $Id: os2timer.cpp,v 1.16 2000-10-01 21:16:29 phaller Exp $ */ 2 2 3 3 /* … … 44 44 { 45 45 typedef DWORD (* CALLBACK LPTHREAD_START_ROUTINE)(LPVOID); 46 46 47 DWORD WIN32API GetLastError(); 48 47 49 HANDLE WIN32API CreateThread(LPSECURITY_ATTRIBUTES lpsa, 48 50 DWORD cbStack, … … 268 270 timers = this; 269 271 272 // create timer semaphore 273 int rc = DosCreateEventSem(NULL, &TimerSem, DC_SEM_SHARED, 0); 274 if(rc != 0) 275 { 276 dprintf(("WINMM: OS2Timer: DosCreateEventSem failed rc=#%08xh\n", rc)); 277 return; // terminate thread 278 } 279 280 270 281 //hTimerThread = _beginthread(TimerHlpHandler, NULL, 0x4000, (void *)this); 271 282 hTimerThread = CreateThread(NULL, … … 275 286 0, // thread creation flags 276 287 &TimerThreadID); 277 278 //@@@PH: CreateThread() should be used instead 279 //@@@PH: logic sux ... waits for creation of semaphores 280 DosSleep(10); 288 289 if (hTimerThread == NULL) 290 { 291 dprintf(("WINMM: OS2Timer: CreateThread failed rc=#%08xh\n", 292 GetLastError())); 293 DosCloseEventSem(TimerSem); 294 } 281 295 } 282 296 /******************************************************************************/ … … 402 416 0L); /* Assume current thread */ 403 417 404 rc = DosCreateEventSem(NULL, &TimerSem, DC_SEM_SHARED, 0);405 if(rc != 0)406 {407 dprintf(("WINMM: OS2Timer: DosCreateEventSem failed rc=#%08xh\n", rc));408 return; // terminate thread409 }410 411 418 TimerStatus = Stopped; 412 419 413 420 while(!fFatal) 414 421 { 422 dprintf(("WINMM: OS2Timer::TimerHandler waiting on timer (%04xh, %08xh\n", 423 dwFlags, 424 clientCallback)); 425 415 426 DosWaitEventSem(TimerSem, SEM_INDEFINITE_WAIT); 416 427 DosResetEventSem(TimerSem, &Count); … … 423 434 if (TimerStatus == Running) 424 435 { 436 dprintf(("WINMM: OS2Timer::TimerHandler firing (%04xh, %08xh\n", 437 dwFlags, 438 clientCallback)); 439 425 440 // process the event 426 441 switch (dwFlags & 0x0030)
Note:
See TracChangeset
for help on using the changeset viewer.