Changeset 528 for trunk/dll


Ignore:
Timestamp:
Nov 4, 2006, 9:59:06 PM (19 years ago)
Author:
root
Message:

Count thread usage

Location:
trunk/dll
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/grep.c

    r517 r528  
    1818  26 Jul 06 SHL Check more run time errors
    1919  19 Oct 06 SHL Correct . and .. detect
     20  03 Nov 06 SHL Count thread usage
    2021
    2122***********************************************************************/
     
    4041static PSZ pszSrcFile = __FILE__;
    4142
    42 #pragma alloc_text(GREP,SecsSince1980,match,mmatch,dogrep)
     43#pragma alloc_text(GREP,SecsSince1980,match,mmatch,GrepThread)
    4344#pragma alloc_text(GREP,doallsubdirs,domatchingfiles)
    4445
     
    235236
    236237
    237 VOID dogrep (VOID *arg)
     238VOID GrepThread (VOID *arg)
    238239{
    239240  HAB           ghab;
     
    258259    if(ghmq) {
    259260      WinCancelShutdown(ghmq,TRUE);
     261      IncrThreadUsage();
    260262      DosSleep(128L);
    261263      WinSetWindowText(grep.hwndCurFile,
     
    371373      WinDestroyMsgQueue(ghmq);
    372374    }
     375    DecrThreadUsage();
    373376    WinTerminate(ghab);
    374377  }
  • trunk/dll/mle.c

    r350 r528  
    1212  16 Apr 06 SHL MLEexportfile: rework to avoid wrap problems
    1313  14 Jul 06 SHL Use Runtime_Error
     14  03 Nov 06 SHL Count thread usage
    1415
    1516***********************************************************************/
     
    769770      if(thmq) {
    770771        WinCancelShutdown(thmq,TRUE);
     772        IncrThreadUsage();
    771773        priority_normal();
    772774        if(bkg->hex == 1)
     
    786788        WinDestroyMsgQueue(thmq);
    787789      }
     790      DecrThreadUsage();
    788791      WinTerminate(thab);
    789792      _endthread();
    790793    }
     794    // fixme to be gone?
    791795    PostMsg(bkg->hwndReport,bkg->msg,MPVOID,MPVOID);
    792796  }
  • trunk/dll/undel.c

    r406 r528  
    1111  17 Jul 06 SHL Use Runtime_Error
    1212  29 Jul 06 SHL Use xfgets_bstripcr
     13  03 Nov 06 SHL Count thread usage
    1314
    1415***********************************************************************/
     
    3334static PSZ pszSrcFile = __FILE__;
    3435
    35 #pragma alloc_text(UNDELETE,FillUndelList,UndeleteDlgProc)
     36#pragma alloc_text(UNDELETE,FillUndelListThread,UndeleteDlgProc)
    3637
    3738struct tempstruct {
     
    4243
    4344
    44 VOID FillUndelList (VOID *arg)
     45static VOID FillUndelListThread (VOID *arg)
    4546{
    4647  HWND  hwnd;
     
    6263  thab = WinInitialize(0);
    6364  thmq = WinCreateMsgQueue(thab,0);
    64   WinCancelShutdown(thmq,TRUE);
    65   if(thab && thmq) {
     65  if (thab && thmq) {
     66    WinCancelShutdown(thmq,TRUE);
     67    IncrThreadUsage();
    6668    WinSendDlgItemMsg(hwnd,UNDEL_LISTBOX,LM_DELETEALL,MPVOID,MPVOID);
    6769    unlinkf("%s","$UDELETE.#$#");
     
    149151    }
    150152Abort:
     153    ;
     154  }
     155  DosForceDelete("$UDELETE.#$#");
     156  if (undelinfo)
     157    free(undelinfo);
     158  if (thmq) {
     159    PostMsg(hwnd,UM_CONTAINER_FILLED,MPVOID,MPVOID);
     160    if (killme)
     161      PostMsg(hwnd,WM_CLOSE,MPVOID,MPVOID);
    151162    WinDestroyMsgQueue(thmq);
     163  }
     164  if (thab) {
     165    DecrThreadUsage();
    152166    WinTerminate(thab);
    153167  }
    154   DosForceDelete("$UDELETE.#$#");
    155   PostMsg(hwnd,
    156           UM_CONTAINER_FILLED,
    157           MPVOID,
    158           MPVOID);
    159   if(killme)
    160     PostMsg(hwnd,
    161             WM_CLOSE,
    162             MPVOID,
    163             MPVOID);
    164   if(undelinfo)
    165     free(undelinfo);
    166168}
    167169
     
    226228                  toupper(*undelinfo->path));
    227229          WinSetWindowText(hwnd,s);
    228           if (_beginthread(FillUndelList,NULL,65536,(PVOID)undelinfo) == -1)
     230          if (_beginthread(FillUndelListThread,NULL,65536,(PVOID)undelinfo) == -1)
    229231          {
    230232            Runtime_Error(pszSrcFile, __LINE__,GetPString(IDS_COULDNTSTARTTHREADTEXT));
Note: See TracChangeset for help on using the changeset viewer.