Changeset 1270 for trunk/dll


Ignore:
Timestamp:
Nov 8, 2008, 9:48:24 PM (17 years ago)
Author:
Gregg Young
Message:

Comments and code cleanup for WaitChildThread solution to hang cused by viewer opening before archiver process closes (Ticket 58)

Location:
trunk/dll
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/arccnrs.c

    r1268 r1270  
    5959  25 Aug 08 GKY Check TMP directory space warn if lee than 5 MiB prevent archiver from opening if
    6060                less than 10 KiB (It hangs and can't be closed)
     61  08 Nov 08 GKY Add WaitChildThread to fix hang caused by viewer trying to open a file before
     62                the archiver process closes. (Ticket 58)
    6163
    6264***********************************************************************/
     
    165167WAITCHILD;
    166168
     169// Creates a thread to wait for a child process to complete then posts a message and closes
    167170VOID WaitChildThread(VOID * arg)
    168171{
    169172  WAITCHILD *WaitChild;
    170   ULONG clPosted;
    171173  HAB thab;
    172174  CHAR *filename;
     
    187189      DosWaitEventSem(hWaitChildSem, SEM_INDEFINITE_WAIT);
    188190      priority_bumped();
    189       DosResetEventSem(hWaitChildSem, &clPosted);
    190191      if (IsFile(WaitChild->filename) == 1)
    191192        PostMsg(WaitChild->hwndCnr, UM_ENTER, MPFROMP(filename), MPVOID);
     
    15851586          p++;
    15861587        }
    1587         //printf("%s %d UM_ENTER %s %x\n",__FILE__, __LINE__,WaitChild->filename, dcd->hwndCnr); fflush(stdout);        // 10 Mar 07 SHL hang
    1588         free(s);
     1588        free(s);
    15891589        WaitChild->hwndCnr = dcd->hwndCnr;
    15901590        rc = _beginthread(WaitChildThread, NULL, 65536, WaitChild);
     
    15971597            DosSleep(100);  // Allow unzip session to finish closing 14 Mar 07 SHL
    15981598#endif
    1599           //DosWaitEventSem(hWaitChildSem, SEM_INDEFINITE_WAIT);
    1600           //WinSendMsg(WaitChild->hwndCnr, UM_ENTER, MPFROMP(WaitChild->filename), MPVOID);
     1599          //WinSendMsg(WaitChild->hwndCnr, UM_ENTER, MPFROMP(filename), MPVOID);
    16011600
    16021601      }
  • trunk/dll/systemf.c

    r1268 r1270  
    2424  26 May 08 SHL Use uiLineNumber correctly
    2525  19 Jul 08 GKY Replace save_dir2(dir) with pFM2SaveDirectory or pTmpDir and use MakeTempName
     26  08 Nov 08 GKY Post an event semaphore to WaitChildThread to fix hang caused by viewer trying
     27                to open a file before the archiver process closes. (Ticket 58)
    2628
    2729***********************************************************************/
     
    11791181        }
    11801182        else {
     1183          ULONG clPosted;
     1184
     1185          DosResetEventSem(hWaitChildSem, &clPosted);
    11811186          for (ctr = 0;; ctr++)
    11821187          {
     
    12101215
    12111216            if (pTermInfo->usSessID == ulSessID) {
    1212               DosPostEventSem(hWaitChildSem);
     1217              DosPostEventSem(hWaitChildSem); //Posted to WaitChildThread (arccnrs.c)
    12131218                break;                    // Our session is done
    12141219            }
Note: See TracChangeset for help on using the changeset viewer.