Changeset 1268
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/dll/arccnrs.c ¶
r1242 r1268 158 158 ULONGLONG ullDATFileSpaceNeeded; 159 159 160 typedef struct { 161 162 CHAR filename[CCHMAXPATH]; 163 HWND hwndCnr; 164 } 165 WAITCHILD; 166 167 VOID WaitChildThread(VOID * arg) 168 { 169 WAITCHILD *WaitChild; 170 ULONG clPosted; 171 HAB thab; 172 CHAR *filename; 173 174 DosError(FERR_DISABLEHARDERR); 175 176 # ifdef FORTIFY 177 Fortify_EnterScope(); 178 # endif 179 180 WaitChild = (WAITCHILD *) arg; 181 if (WaitChild) { 182 filename = xstrdup(WaitChild->filename, pszSrcFile, __LINE__); 183 thab = WinInitialize(0); 184 if (thab) { 185 IncrThreadUsage(); 186 priority_normal(); 187 DosWaitEventSem(hWaitChildSem, SEM_INDEFINITE_WAIT); 188 priority_bumped(); 189 DosResetEventSem(hWaitChildSem, &clPosted); 190 if (IsFile(WaitChild->filename) == 1) 191 PostMsg(WaitChild->hwndCnr, UM_ENTER, MPFROMP(filename), MPVOID); 192 DecrThreadUsage(); 193 WinTerminate(thab); 194 } 195 free(WaitChild); 196 } // if WaitChild 197 # ifdef FORTIFY 198 Fortify_LeaveScope(); 199 # endif 200 _endthread(); 201 } 202 160 203 static MRESULT EXPENTRY ArcErrProc(HWND hwnd, ULONG msg, MPARAM mp1, 161 204 MPARAM mp2) … … 593 636 } 594 637 else { 595 runemf2(SEPARATE | INVISIBLE | FULLSCREEN| BACKGROUND | WAIT,638 runemf2(SEPARATE | INVISIBLE | MINIMIZED | BACKGROUND | WAIT, 596 639 hwndCnr, pszSrcFile, __LINE__, NULL, NULL, 597 640 "%s %s", … … 1384 1427 } 1385 1428 // saymsg(MB_ENTER,HWND_DESKTOP,DEBUG_STRING,"%s %s %s\r[%s]",dcd->info->extract,dcd->arcname,membername,construct); 1386 runemf2(SEPARATE | WINDOWED | WAIT |1429 runemf2(SEPARATE | WINDOWED | ASYNCHRONOUS | WAIT | 1387 1430 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED), 1388 1431 dcd->hwndClient, pszSrcFile, __LINE__, construct, NULL, … … 1503 1546 if (dcd) { 1504 1547 1505 CHAR *s = (CHAR *) mp1, *p, *pp, filename[CCHMAXPATH]; 1506 1548 CHAR *s = (CHAR *) mp1, *p, *pp; // filename[CCHMAXPATH]; 1549 WAITCHILD *WaitChild; 1550 APIRET rc; 1551 1552 WaitChild = xmallocz(sizeof(WAITCHILD), pszSrcFile, __LINE__); 1553 if (!WaitChild) 1554 return 0; 1507 1555 if (s) { 1508 1556 if (!dcd->info->extract) { … … 1511 1559 return 0; 1512 1560 } 1513 runemf2(SEPARATE | WINDOWED| WAIT |1514 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED),1561 runemf2(SEPARATE | ASYNCHRONOUS | WAIT | 1562 (fArcStuffVisible ? 0 : BACKGROUND), 1515 1563 dcd->hwndClient, pszSrcFile, __LINE__, dcd->workdir, NULL, 1516 1564 "%s %s %s", … … 1530 1578 memmove(s, p + 1, strlen(p + 1)); 1531 1579 } 1532 sprintf( filename, "%s\\%s", dcd->workdir, s);1533 p = filename;1580 sprintf(WaitChild->filename, "%s\\%s", dcd->workdir, s); 1581 p = WaitChild->filename; 1534 1582 while (*p) { 1535 1583 if (*p == '/') … … 1537 1585 p++; 1538 1586 } 1539 // printf("%s %d UM_ENTER %s %s\n",__FILE__, __LINE__,filename, s); fflush(stdout); // 10 Mar 07 SHL hang 1540 free(s); 1541 if (IsFile(filename) == 1) { 1542 #if 1 // 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58 testing 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); 1589 WaitChild->hwndCnr = dcd->hwndCnr; 1590 rc = _beginthread(WaitChildThread, NULL, 65536, WaitChild); 1591 if (rc == -1) 1592 Runtime_Error(pszSrcFile, __LINE__, 1593 GetPString(IDS_COULDNTSTARTTHREADTEXT)); 1594 //if (IsFile(filename) == 1) { 1595 #if 0 // 06 Oct 07 SHL fixme to be gone - set to 0 for ticket #58 testing 1543 1596 if (fViewChild && fArcStuffVisible) 1544 1597 DosSleep(100); // Allow unzip session to finish closing 14 Mar 07 SHL 1545 1598 #endif 1546 WinSendMsg(dcd->hwndCnr, UM_ENTER, MPFROMP(filename), MPVOID); 1547 } 1599 //DosWaitEventSem(hWaitChildSem, SEM_INDEFINITE_WAIT); 1600 //WinSendMsg(WaitChild->hwndCnr, UM_ENTER, MPFROMP(WaitChild->filename), MPVOID); 1601 1548 1602 } 1549 1603 } … … 1610 1664 if (!li->list[x] || strlen(szBuffer) + 1611 1665 strlen(li->list[x]) + 5 > MaxComLineStrg) { 1612 runemf2(SEPARATE | WINDOWED | 1613 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) | 1614 WAIT,hwnd, pszSrcFile, __LINE__,1666 runemf2(SEPARATE | WINDOWED | ASYNCHRONOUS | 1667 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED), 1668 hwnd, pszSrcFile, __LINE__, 1615 1669 NULL, NULL, "%s", szBuffer); 1616 1670 *p = 0; … … 1676 1730 } 1677 1731 z = x; 1678 runemf2(SEPARATE | WINDOWED | WAIT |1732 runemf2(SEPARATE | WINDOWED | ASYNCHRONOUS | WAIT | 1679 1733 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED), 1680 1734 hwnd, pszSrcFile, __LINE__, NullStr, NULL, "%s", pszCmdLine); … … 1802 1856 } 1803 1857 z = x; 1804 runemf2(SEPARATE | WINDOWED | 1805 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED) | 1806 WAIT,hwnd, pszSrcFile, __LINE__,1858 runemf2(SEPARATE | WINDOWED | ASYNCHRONOUS | 1859 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED), 1860 hwnd, pszSrcFile, __LINE__, 1807 1861 li->targetpath, NULL, "%s", pszCmdLine); 1808 1862 *endofit = 0; … … 2554 2608 2555 2609 case UM_ENTER: 2556 if (WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID)) 2610 if (WinSendMsg(hwnd, UM_SETDIR, MPVOID, MPVOID)) { 2611 free(mp1); 2557 2612 return 0; 2613 } 2558 2614 SetShiftState(); 2559 2615 if (dcd && (CHAR *) mp1) { … … 2561 2617 SWP swp; 2562 2618 CHAR *filename = mp1; 2563 2564 if (IsFile(filename) != 1) 2565 return 0; 2619 printf("%s %d UM_ENTER %s\n",__FILE__, __LINE__, filename); fflush(stdout); 2620 if (IsFile(filename) != 1) { 2621 free(mp1); 2622 return 0; 2623 } 2566 2624 WinQueryWindowPos(dcd->hwndFrame, &swp); 2567 2625 DefaultViewKeys(hwnd, dcd->hwndFrame, dcd->hwndParent, &swp, filename); … … 2569 2627 UnHilite(hwnd, FALSE, &dcd->lastselection, 0); 2570 2628 } 2629 free(mp1); 2571 2630 return 0; 2572 2631 … … 2913 2972 case IDM_ARCEXTRACT: 2914 2973 if (dcd->info->extract) 2915 runemf2(SEPARATE | WINDOWED | 2974 runemf2(SEPARATE | WINDOWED | ASYNCHRONOUS | 2916 2975 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED), 2917 2976 hwnd, pszSrcFile, __LINE__, … … 2925 2984 case IDM_ARCEXTRACTWDIRS: 2926 2985 if (dcd->info->exwdirs) 2927 runemf2(SEPARATE | WINDOWED | 2986 runemf2(SEPARATE | WINDOWED | ASYNCHRONOUS | 2928 2987 (fArcStuffVisible ? 0 : BACKGROUND | MINIMIZED), 2929 2988 hwnd, pszSrcFile, __LINE__, -
TabularUnified 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 -
TabularUnified trunk/dll/systemf.h ¶
r1227 r1268 48 48 EXECARGS; 49 49 50 extern HEV hWaitChildSem; 51 50 52 INT ExecOnList(HWND hwnd, CHAR * command, INT flags, CHAR * tpath, 51 53 CHAR ** list, CHAR * prompt, PCSZ pszCallingFile, UINT uiLineNumber);
Note:
See TracChangeset
for help on using the changeset viewer.