Changeset 533 for trunk/dll/worker.c


Ignore:
Timestamp:
Nov 4, 2006, 10:07:44 PM (19 years ago)
Author:
root
Message:

Renames
Count thread usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/worker.c

    r396 r533  
    1616  22 Jul 06 SHL Comments
    1717  22 Jul 06 SHL Check more run time errors
     18  03 Nov 06 SHL Renames
     19  03 Nov 06 SHL Count thread usage
    1820
    1921***********************************************************************/
     
    119121  CHAR **files = NULL;
    120122  INT numfiles = 0, numalloc = 0, plen = 0;
    121   register CHAR *p, *pp;
    122 
    123   if (wk)
    124   {
     123  CHAR *p, *pp;
     124
     125  if (wk) {
    125126    if (wk -> li &&
    126127        wk -> li -> list &&
     
    128129    {
    129130      hab2 = WinInitialize(0);
    130       if (hab2)
    131       {
     131      if (hab2) {
    132132        hmq2 = WinCreateMsgQueue(hab2, 0);
    133         if (hmq2)
    134         {
    135 
     133        if (hmq2) {
    136134          CHAR message[(CCHMAXPATH * 2) + 80], wildname[CCHMAXPATH];
    137135          register INT x;
     
    140138
    141139          WinCancelShutdown(hmq2, TRUE);
    142           if (hwndMain)
    143             WinSendMsg(hwndMain,
    144                        UM_THREADUSE,
    145                        MPFROMLONG(1L),
    146                        MPVOID);
     140          IncrThreadUsage();
    147141          *wildname = 0;
    148142          switch (wk -> li -> type)
     
    10271021                else if (*compare)
    10281022                {
    1029 
    10301023                  CHAR *fakelist[3];
    10311024
     
    10421035                else
    10431036                {
    1044 
    10451037                  FCOMPARE fc;
    10461038
     
    10591051                }
    10601052                break;
    1061               }
     1053              } // switch
    10621054              DosSleep(0L);
    1063             }
     1055            } // for list
    10641056
    10651057            switch (wk -> li -> type)
     
    11121104        Abort:
    11131105
    1114           if (files)
    1115           {
     1106          if (files) {
    11161107            Broadcast(hab2,
    11171108                      wk -> hwndCnr,
     
    11231114
    11241115          if (WinIsWindow(hab2, wk -> hwndCnr))
    1125             PostMsg(wk -> hwndCnr,
    1126                     UM_RESCAN,
    1127                     MPVOID,
    1128                     MPVOID);
    1129 
    1130           if (hwndMain)
    1131             WinSendMsg(hwndMain,
    1132                        UM_THREADUSE,
    1133                        MPVOID,
    1134                        MPVOID);
     1116            PostMsg(wk -> hwndCnr,UM_RESCAN,MPVOID,MPVOID);
     1117
    11351118          WinDestroyMsgQueue(hmq2);
    11361119        }
     1120        DecrThreadUsage();
    11371121        WinTerminate(hab2);
    11381122      }
     
    11631147      {
    11641148        hmq2 = WinCreateMsgQueue(hab2, 0);
    1165         if (hmq2)
    1166         {
     1149        if (hmq2) {
    11671150          WinCancelShutdown(hmq2, TRUE);
    1168           if (hwndMain)
    1169             WinSendMsg(hwndMain,
    1170                        UM_THREADUSE,
    1171                        MPFROMLONG(1L),
    1172                        MPVOID);
     1151          IncrThreadUsage();
    11731152          DosError(FERR_DISABLEHARDERR);
    11741153          if (IsRoot(wk -> li -> list[0]) ||
     
    11801159              wk -> li -> type = IDM_EAS;
    11811160          }
    1182           switch (wk -> li -> type)
    1183           {
     1161          switch (wk -> li -> type) {
    11841162          case IDM_INFO:
    11851163            if (WinDlgBox(HWND_DESKTOP,
     
    16891667              {
    16901668                strcpy(wk -> li -> targetpath, printer);
    1691                 if (_beginthread(PrintList,NULL,65536,(PVOID) wk -> li) == -1)
     1669                if (_beginthread(PrintListThread,NULL,65536,(PVOID) wk -> li) == -1)
    16921670                  Runtime_Error(pszSrcFile, __LINE__, GetPString(IDS_COULDNTSTARTTHREADTEXT));
    16931671                else
     
    19221900            break;
    19231901          }
    1924           if (files)
    1925           {
     1902          if (files) {
    19261903            Broadcast(hab2,
    19271904                      wk -> hwndCnr,
     
    19331910        Abort:
    19341911          if (WinIsWindow(hab2, wk -> hwndCnr))
    1935             PostMsg(wk -> hwndCnr,
    1936                     UM_RESCAN,
    1937                     MPVOID,
    1938                     MPVOID);
    1939 
    1940           if (hwndMain)
    1941             WinSendMsg(hwndMain,
    1942                        UM_THREADUSE,
    1943                        MPVOID,
    1944                        MPVOID);
     1912            PostMsg(wk -> hwndCnr,UM_RESCAN,MPVOID,MPVOID);
     1913
    19451914          WinDestroyMsgQueue(hmq2);
    19461915        }
     1916        DecrThreadUsage();
    19471917        WinTerminate(hab2);
    19481918      }
Note: See TracChangeset for help on using the changeset viewer.