Changeset 536


Ignore:
Timestamp:
Nov 4, 2006, 9:09:21 PM (14 years ago)
Author:
root
Message:

Rework thread usage count logic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/common.c

    r446 r536  
    1212  22 Jul 06 SHL Check more run time errors
    1313  15 Aug 06 SHL Use Dos_Error
     14  03 Nov 06 SHL Rework thread usage count logic
    1415
    1516***********************************************************************/
     
    4344#pragma alloc_text(COMMON1,CommonCreateTextChildren,CommonCreateMainChildren)
    4445#pragma alloc_text(COMMON2,CommonDriveCmd,CommonTextButton)
    45 #pragma alloc_text(COMMON3,CommonMainWndProc)
     46#pragma alloc_text(COMMON3,CommonMainWndProc,IncrThreadUsage,DecrThreadUsage)
    4647#pragma alloc_text(COMMON4,CommonCnrProc)
    4748#pragma alloc_text(COMMON5,OpenDirCnr)
     
    655656    case UM_THREADUSE:
    656657      if (hbmLEDon && hbmLEDoff) {
    657         static LONG threaduse = 0;
     658        static LONG threaduse;
    658659        CHAR ts[33];
    659660
     
    670671            if(threaduse <= 0) {
    671672              threaduse = 0;
    672             WinSendMsg(hwndLED,
    673                        SM_SETHANDLE,
    674                        MPFROMLONG(hbmLEDoff),
    675                        MPVOID);
     673              WinSendMsg(hwndLED,
     674                         SM_SETHANDLE,
     675                         MPFROMLONG(hbmLEDoff),
     676                         MPVOID);
    676677          }
    677678        }
    678         ltoa(threaduse,
    679              ts,
    680              10);
    681         WinSetWindowText(hwndLEDHdr,
    682                          ts);
     679        ltoa(threaduse,ts,10);
     680        WinSetWindowText(hwndLEDHdr,ts);
     681        DosSleep(0);
    683682      }
    684683      return 0;
     
    988987}
    989988
     989//= IncrThreadUsage() Increment thread usage counter ==
     990
     991VOID IncrThreadUsage(VOID)
     992{
     993  if (hwndMain)
     994    WinPostMsg(hwndMain,UM_THREADUSE,MPFROMLONG(1),MPVOID);
     995}
     996
     997
     998//= DecrThreadUsage() Decrement thread usage counter ==
     999
     1000VOID DecrThreadUsage(VOID)
     1001{
     1002  if (hwndMain)
     1003    WinPostMsg(hwndMain,UM_THREADUSE,MPVOID,MPVOID);
     1004}
Note: See TracChangeset for help on using the changeset viewer.