Changeset 1268 for trunk/dll/systemf.c
- Timestamp:
- Oct 31, 2008, 4:19:47 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/systemf.c
r1252 r1268 60 60 61 61 static PSZ pszSrcFile = __FILE__; 62 63 HEV hWaitChildSem; 62 64 63 65 //static HAPP Exec(HWND hwndNotify, BOOL child, char *startdir, char *env, … … 690 692 static char szTermQName[30]; 691 693 static HQUEUE hTermQ; 692 static HEV hTermQSem;694 //static HEV hTermQSem; 693 695 694 696 if (pszDirectory && *pszDirectory) { … … 1078 1080 } 1079 1081 else { 1080 rc = DosCreateEventSem(NULL,(PHEV)&h TermQSem,0,FALSE);1082 rc = DosCreateEventSem(NULL,(PHEV)&hWaitChildSem,0,FALSE); 1081 1083 if (rc) { 1082 h TermQSem = (HEV)0; // Try to survive1084 hWaitChildSem = (HEV)0; // Try to survive 1083 1085 DosCloseQueue(hTermQ); 1084 1086 hTermQ = (HQUEUE)0; // Try to survive 1085 1087 DosExitCritSec(); 1086 Dos_Error(MB_ENTER,rc,HWND_DESKTOP,pszSrcFile,__LINE__,"Do CreateEventSem");1088 Dos_Error(MB_ENTER,rc,HWND_DESKTOP,pszSrcFile,__LINE__,"DosCreateEventSem"); 1087 1089 } 1088 1090 // if (!rc) fprintf(stderr,"%s %d qcreated ptib %x hTermQ %x\n",__FILE__, __LINE__,ptib,hTermQ); 1089 1091 } 1090 1092 } // if 1st time 1091 useTermQ = hTermQ && h TermQSem;1093 useTermQ = hTermQ && hWaitChildSem; 1092 1094 if (!rc) 1093 1095 DosExitCritSec(); … … 1130 1132 // sdata.PgmInputs, sdata.TermQ, sdata.InheritOpt, 1131 1133 // sdata.SessionType, szTermQName, 1132 // hTermQ, h TermQSem); fflush(stdout);1134 // hTermQ, hWaitChildSem); fflush(stdout); 1133 1135 ret = DosStartSession(&sdata, &ulSessID, &sessPID); 1134 1136 … … 1168 1170 if (DosSetSession(ulSessID, &sd)) // Check if session gone (i.e. finished) 1169 1171 break; 1170 if (ctr > 10) {1172 if (ctr > 20) { 1171 1173 // printf("%s %d thread 0x%x showing slow sess %u pid 0x%x\n", 1172 1174 // __FILE__, __LINE__,ptib->tib_ordinal,ulSessID,sessPID); fflush(stdout); // 12 Mar 07 SHL … … 1181 1183 if (ctr < 20) { 1182 1184 rc = DosReadQueue(hTermQ, &rq, &ulLength, (PPVOID)&pTermInfo, 0, 1183 DCWW_NOWAIT, &bPriority, h TermQSem);1185 DCWW_NOWAIT, &bPriority, hWaitChildSem); 1184 1186 if (rc == ERROR_QUE_EMPTY) { 1185 1187 DosSleep(50);//05 Aug 07 GKY 100 … … 1204 1206 } 1205 1207 1206 // printf("%s %d DosReadQueue thread 0x%x sess %u sessRC %u rq.pid 0x%x rq.data 0x%x\n", 1207 // __FILE__, __LINE__,ptib->tib_ordinal,pTermInfo->usSessID,pTermInfo->usRC,rq.pid, rq.ulData); fflush(stdout); 1208 1209 if (pTermInfo->usSessID == ulSessID) 1210 break; // Our session is done 1208 //printf("%s %d DosReadQueue thread 0x%x sess %u sessRC %u rq.pid 0x%x rq.data 0x%x\n", 1209 // __FILE__, __LINE__,ptib->tib_ordinal,pTermInfo->usSessID,pTermInfo->usRC,rq.pid, rq.ulData); fflush(stdout); 1210 1211 if (pTermInfo->usSessID == ulSessID) { 1212 DosPostEventSem(hWaitChildSem); 1213 break; // Our session is done 1214 } 1211 1215 1212 1216 // Requeue session for other thread
Note:
See TracChangeset
for help on using the changeset viewer.