Changeset 1271 for trunk/dll/systemf.c


Ignore:
Timestamp:
Nov 10, 2008, 4:58:50 AM (17 years ago)
Author:
Gregg Young
Message:

A fix for the ticket 58 hang which runs runemf2 with the WAIT flag in a separate thread. This appears to fix Ticket 58 for all cases. Removed semaphore fix and reverted hTermQSem code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r1270 r1271  
    6262
    6363static PSZ pszSrcFile = __FILE__;
    64 
    65 HEV hWaitChildSem;
    6664
    6765//static HAPP Exec(HWND hwndNotify, BOOL child, char *startdir, char *env,
     
    694692  static char szTermQName[30];
    695693  static HQUEUE hTermQ;
    696   //static HEV hTermQSem;
     694  static HEV hTermQSem;
    697695
    698696  if (pszDirectory && *pszDirectory) {
     
    10821080          }
    10831081          else {
    1084             rc = DosCreateEventSem(NULL,(PHEV)&hWaitChildSem,0,FALSE);
     1082            rc = DosCreateEventSem(NULL,(PHEV)&hTermQSem,0,FALSE);
    10851083            if (rc) {
    1086                 hWaitChildSem = (HEV)0;     // Try to survive
     1084                hTermQSem = (HEV)0;     // Try to survive
    10871085                DosCloseQueue(hTermQ);
    10881086                hTermQ = (HQUEUE)0;     // Try to survive
     
    10931091          }
    10941092        } // if 1st time
    1095         useTermQ = hTermQ && hWaitChildSem;
     1093        useTermQ = hTermQ && hTermQSem;
    10961094        if (!rc)
    10971095          DosExitCritSec();
     
    11341132      //     sdata.PgmInputs, sdata.TermQ, sdata.InheritOpt,
    11351133      //   sdata.SessionType, szTermQName,
    1136       //   hTermQ, hWaitChildSem); fflush(stdout);
     1134      //   hTermQ, ); fflush(stdout);
    11371135      ret = DosStartSession(&sdata, &ulSessID, &sessPID);
    11381136
     
    11811179        }
    11821180        else {
    1183           ULONG clPosted;
    1184 
    1185           DosResetEventSem(hWaitChildSem, &clPosted);
    11861181          for (ctr = 0;; ctr++)
    11871182          {
    11881183            if (ctr < 20) {
    11891184              rc = DosReadQueue(hTermQ, &rq, &ulLength, (PPVOID)&pTermInfo, 0,
    1190                                 DCWW_NOWAIT, &bPriority, hWaitChildSem);
     1185                                DCWW_NOWAIT, &bPriority, hTermQSem);
    11911186              if (rc == ERROR_QUE_EMPTY) {
    11921187                DosSleep(50);//05 Aug 07 GKY 100
     
    12151210
    12161211            if (pTermInfo->usSessID == ulSessID) {
    1217               DosPostEventSem(hWaitChildSem); //Posted to WaitChildThread (arccnrs.c)
    1218                 break;                    // Our session is done
     1212              priority_bumped();
     1213              break;                    // Our session is done
    12191214            }
    12201215
Note: See TracChangeset for help on using the changeset viewer.