Changeset 563 for trunk/dll/systemf.c


Ignore:
Timestamp:
Mar 15, 2007, 6:21:34 AM (18 years ago)
Author:
Steven Levine
Message:

Avoid DosStartSession viewer hangs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/systemf.c

    r562 r563  
    10821082      }
    10831083
    1084      // printf("%s %d DosStartsession thread 0x%x data\n ",
     1084      // printf("%s %d DosStartsession thread 0x%x data\n ",
    10851085      //       __FILE__, __LINE__,ptib->tib_ordinal); fflush(stdout);   // 10 Mar 07 SHL hang
    1086      // printf(" %d %d %d %s %s %s %d %d\n %s %x %x\n",
     1086      // printf(" %d %d %d %s %s %s %d %d\n %s %x %x\n",
    10871087      //       sdata.Length , sdata.Related, sdata.FgBg, sdata.PgmName,
    1088         //     sdata.PgmInputs, sdata.TermQ, sdata.InheritOpt,
    1089           //   sdata.SessionType, szTermQName,
    1090        //   hTermQ, hTermQSem); fflush(stdout);
     1088      //     sdata.PgmInputs, sdata.TermQ, sdata.InheritOpt,
     1089      //   sdata.SessionType, szTermQName,
     1090      //   hTermQ, hTermQSem); fflush(stdout);
    10911091      ret = DosStartSession(&sdata, &ulSessID, &sessPID);
    1092       if (type & WAIT) {
    1093        // printf("%s %d DosStartession thread 0x%x rc = %d sess = %u pid = 0x%x\n",
    1094        //        __FILE__, __LINE__, ptib->tib_ordinal,ret, ulSessID, sessPID); fflush(stdout); // 10 Mar 07 SHL hang
    1095       }
    1096       else {
    1097        // printf("%s %d DosStartession thread 0x%x nowait rc = %d\n",
    1098          //      __FILE__, __LINE__, ptib->tib_ordinal,ret); fflush(stdout);    // 10 Mar 07 SHL hang
    1099       }
     1092
     1093      // if (type & WAIT) {
     1094      // printf("%s %d DosStartession thread 0x%x rc = %d sess = %u pid = 0x%x\n",
     1095      //        __FILE__, __LINE__, ptib->tib_ordinal,ret, ulSessID, sessPID); fflush(stdout);  // 10 Mar 07 SHL hang
     1096      // }
     1097      // else {
     1098      // printf("%s %d DosStartession thread 0x%x nowait rc = %d\n",
     1099      //      __FILE__, __LINE__, ptib->tib_ordinal,ret); fflush(stdout);       // 10 Mar 07 SHL hang
     1100      // }
    11001101
    11011102      if (pszDirectory && *pszDirectory)
     
    11131114          STATUSDATA sd;
    11141115          // Could not create queue - fallback - fixme to be gone?
    1115          // printf("%s %d waiting wo/termq\n", __FILE__, __LINE__); fflush(stdout);     // 12 Mar 07 SHL hang
     1116          // printf("%s %d waiting wo/termq\n", __FILE__, __LINE__); fflush(stdout);    // 12 Mar 07 SHL hang
    11161117
    11171118          memset(&sd, 0, sizeof(sd));
     
    11251126              break;
    11261127            if (ctr > 10) {
    1127            //   printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n",
    1128              //        __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,sessPID); fflush(stdout);  // 12 Mar 07 SHL
     1128              //   printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n",
     1129              //        __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,sessPID); fflush(stdout); // 12 Mar 07 SHL
    11291130              ShowSession(hwnd, sessPID);       // Show every 2 seconds
    11301131              ctr = 0;
     
    11451146            else {
    11461147              if (ctr == 20) {
    1147                // printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n",
     1148                // printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n",
    11481149                //       __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,sessPID); fflush(stdout);
    11491150                ShowSession(hwnd, sessPID);             // Show long running session
    11501151              }
    1151              // printf("%s %d thread 0x%x waiting for slow sess %u pid 0x%x\n",
    1152                //      __FILE__, __LINE__,ptib->tib_ordinal,ulSessID, sessPID); fflush(stdout);
    11531152              rc = DosReadQueue(hTermQ, &rq, &ulLength, (PPVOID)&pTermInfo, 0,
    11541153                                DCWW_WAIT, &bPriority, 0);
     
    11621161            }
    11631162
    1164           //  printf("%s %d DosReadQueue thread 0x%x sess %u sessRC %u rq.pid 0x%x rq.data 0x%x\n",
     1163            //  printf("%s %d DosReadQueue thread 0x%x sess %u sessRC %u rq.pid 0x%x rq.data 0x%x\n",
    11651164            //       __FILE__, __LINE__,ptib->tib_ordinal,pTermInfo->usSessID,pTermInfo->usRC,rq.pid, rq.ulData); fflush(stdout);
    11661165
    1167             // might be looping here if confused about session id - fixme to ensure not possible?
    11681166            if (pTermInfo->usSessID == ulSessID)
    11691167              break;                    // Our session is done
     
    11721170            {
    11731171              static ULONG ulLastSessID;
    1174              // printf("%s %d requeue thread 0x%x our sess %u term sess %u term rc %u\n",
     1172              // printf("%s %d requeue thread 0x%x our sess %u term sess %u term rc %u\n",
    11751173              //       __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,pTermInfo->usSessID,pTermInfo->usRC); fflush(stdout);
    11761174              // fixme to be gone when no longer needed for debug?
     
    11881186
    11891187          ret = pTermInfo->usRC == 0;           // Set 1 if rc 0 else 0
    1190          // printf("%s %d thread 0x%x term for sess %u\n",
    1191            //      __FILE__, __LINE__,ptib->tib_ordinal,ulSessID);fflush(stdout);
     1188          // printf("%s %d thread 0x%x term for sess %u\n",
     1189          //      __FILE__, __LINE__,ptib->tib_ordinal,ulSessID);fflush(stdout);
    11921190          DosFreeMem(pTermInfo);
    11931191        }
Note: See TracChangeset for help on using the changeset viewer.