Changeset 528 for trunk/dll/undel.c


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

Count thread usage

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.