Changeset 551 for trunk/dll/timer.c
- Timestamp:
- Feb 28, 2007, 2:33:51 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/timer.c
r329 r551 32 32 static HEV hevTimerSem; 33 33 34 static void TimerThread 34 static void TimerThread(void *args) 35 35 { 36 HAB 37 HMQ 36 HAB hab2; 37 HMQ hmq2; 38 38 ULONG cntr = 0; 39 39 40 40 priority_bumped(); 41 41 hab2 = WinInitialize(0); 42 if(hab2) { 43 hmq2 = WinCreateMsgQueue(hab2, 44 0); 45 if(hmq2) { 46 WinCancelShutdown(hmq2, 47 TRUE); 48 if(!DosCreateEventSem(NULL, 49 &hevTimerSem, 50 0, 51 FALSE)) { 52 for(;;) { 53 if(DosWaitEventSem(hevTimerSem, 54 3000) != 55 ERROR_TIMEOUT) 56 break; 57 cntr++; 58 if(hwndTree && 59 !(cntr % 3)) 60 PostMsg(hwndTree, 61 UM_TIMER, 62 MPVOID, 63 MPVOID); 64 if(hwndBubble && 65 WinIsWindowVisible(hwndBubble)) 66 PostMsg(hwndBubble, 67 UM_TIMER, 68 MPVOID, 69 MPVOID); 70 if(DataHwnd) 71 PostMsg(DataHwnd, 72 UM_TIMER, 73 MPVOID, 74 MPVOID); 75 } 76 DosCloseEventSem(hevTimerSem); 42 if (hab2) { 43 hmq2 = WinCreateMsgQueue(hab2, 0); 44 if (hmq2) { 45 WinCancelShutdown(hmq2, TRUE); 46 if (!DosCreateEventSem(NULL, &hevTimerSem, 0, FALSE)) { 47 for (;;) { 48 if (DosWaitEventSem(hevTimerSem, 3000) != ERROR_TIMEOUT) 49 break; 50 cntr++; 51 if (hwndTree && !(cntr % 3)) 52 PostMsg(hwndTree, UM_TIMER, MPVOID, MPVOID); 53 if (hwndBubble && WinIsWindowVisible(hwndBubble)) 54 PostMsg(hwndBubble, UM_TIMER, MPVOID, MPVOID); 55 if (DataHwnd) 56 PostMsg(DataHwnd, UM_TIMER, MPVOID, MPVOID); 57 } 58 DosCloseEventSem(hevTimerSem); 77 59 } 78 60 WinDestroyMsgQueue(hmq2); … … 84 66 //== StartTimer() return TRUE can start thread == 85 67 86 BOOL StartTimer 68 BOOL StartTimer(void) 87 69 { 88 INT rc = _beginthread(TimerThread, NULL,32768,(PVOID)0);70 INT rc = _beginthread(TimerThread, NULL, 32768, (PVOID) 0); 89 71 90 72 if (rc == -1) 91 Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT)); 73 Runtime_Error(pszSrcFile, __LINE__, 74 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 92 75 93 76 return rc != -1; 94 77 } 95 78 96 void StopTimer 79 void StopTimer(void) 97 80 { 98 81 DosPostEventSem(hevTimerSem); 99 82 } 100
Note:
See TracChangeset
for help on using the changeset viewer.