Changeset 551 for trunk/dll/timer.c


Ignore:
Timestamp:
Feb 28, 2007, 2:33:51 AM (18 years ago)
Author:
Gregg Young
Message:

Indentation cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/timer.c

    r329 r551  
    3232static HEV hevTimerSem;
    3333
    34 static void TimerThread (void *args)
     34static void TimerThread(void *args)
    3535{
    36   HAB   hab2;
    37   HMQ   hmq2;
     36  HAB hab2;
     37  HMQ hmq2;
    3838  ULONG cntr = 0;
    3939
    4040  priority_bumped();
    4141  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);
    7759      }
    7860      WinDestroyMsgQueue(hmq2);
     
    8466//== StartTimer() return TRUE can start thread ==
    8567
    86 BOOL StartTimer (void)
     68BOOL StartTimer(void)
    8769{
    88   INT rc = _beginthread(TimerThread,NULL,32768,(PVOID)0);
     70  INT rc = _beginthread(TimerThread, NULL, 32768, (PVOID) 0);
    8971
    9072  if (rc == -1)
    91     Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT));
     73    Runtime_Error(pszSrcFile, __LINE__,
     74                  GetPString(IDS_COULDNTSTARTTHREADTEXT));
    9275
    9376  return rc != -1;
    9477}
    9578
    96 void StopTimer (void)
     79void StopTimer(void)
    9780{
    9881  DosPostEventSem(hevTimerSem);
    9982}
    100 
Note: See TracChangeset for help on using the changeset viewer.