Changeset 1874
Legend:
- Unmodified
- Added
- Removed
-
trunk/dll/dircnrs.c
r1873 r1874 93 93 duplicate subdirectory name caused by running Stubby in worker threads. 94 94 07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh 95 26 Sep 15 GKY Add code so case UM_TOPDIR actually exists put it in the object window so it 96 can call WaitFleshWorkListEmpty while avoiding thread 1 97 27 Sep 15 GKY DosSleep times in WaitFleshWorkListEmpty set by caller 95 98 96 99 ***********************************************************************/ … … 856 859 return 0; 857 860 861 case UM_TOPDIR: 862 if (mp1) { 863 dcd = WinQueryWindowPtr(hwnd, QWL_USER); 864 if (dcd) { 865 PCNRITEM pci = (PCNRITEM) mp1; 866 WaitFleshWorkListEmpty(pci->pszFileName, 240L); 867 ShowCnrRecord(dcd->hwndCnr, (PMINIRECORDCORE) pci); 868 } 869 } 870 return 0; 871 858 872 case UM_RESCAN: 859 873 // populate container … … 2862 2876 driveserial[toupper(*pci->pszFileName) - 'A'] != 2863 2877 volser.serial)) { 2864 // 2015-08-07 SHL FIXME to wait for Flesh to finish before PostMsg 2878 // 2015-08-07 SHL FIXME to wait for Flesh to finish before PostMsg 2879 // 2015-09-26 GKY Waits (WaitFleshWorkListEmpty) in object window 2880 DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); 2865 2881 if (SHORT2FROMMP(mp1) == CN_EXPANDTREE && AddFleshWorkRequest(hwnd, pci, eFlesh) && 2866 !dcd->suspendview && fTopDir && !fSwitchTreeOnDirChg) {2867 PostMsg( hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID);2868 //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci);2882 !dcd->suspendview && fTopDir) { 2883 PostMsg(dcd->hwndObject, UM_TOPDIR, MPFROMP(pci), MPVOID); 2884 DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); 2869 2885 } 2870 2886 } … … 2872 2888 } 2873 2889 } 2874 else if (SHORT2FROMMP(mp1) == CN_EXPANDTREE) { 2890 else if (SHORT2FROMMP(mp1) == CN_EXPANDTREE) { 2891 DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); 2875 2892 if (AddFleshWorkRequest(hwnd, pci, eFlesh) && !dcd->suspendview && 2876 fTopDir && !fSwitchTreeOnDirChg) { 2877 // 2015-08-07 SHL FIXME to wait for Flesh to finish before PostMsg 2878 PostMsg(hwnd, UM_TOPDIR, MPFROMP(pci), MPVOID); 2879 //DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); 2893 fTopDir) { 2894 // 2015-08-07 SHL FIXME to wait for Flesh to finish before PostMsg 2895 // 2015-09-26 GKY Waits (WaitFleshWorkListEmpty) in object window 2896 PostMsg(dcd->hwndObject, UM_TOPDIR, MPFROMP(pci), MPVOID); 2897 DbgMsg(pszSrcFile, __LINE__, "UM_TOPDIR %p pci %p", hwnd, pci); 2880 2898 } 2881 2899 } -
trunk/dll/flesh.c
r1873 r1874 44 44 26 Sep 15 GKY WaitFleshWorkListEmpty now gives error message and returns if semaphore request 45 45 fails more than 5 consecutive times. 46 27 Sep 15 GKY DosSleep times in WaitFleshWorkListEmpty set by caller 46 47 47 48 ***********************************************************************/ … … 263 264 MPFROMP(pciParent), 264 265 MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER)); 265 // No children or filename null266 // Added by Stubby to create plus sign run Stubby on it here and skip it in ProcessDirectory 266 267 if (pciL && (INT)pciL != -1) { 267 268 AddFleshWorkRequest(hwndCnr, pciL, eStubby); 268 // 2015-08-06 SHL FIXME to ensure this an not happen269 // 2015-08-06 SHL FIXME to ensure this can not happen 269 270 if (!*pciL->pszFileName || !strcmp(pciL->pszFileName, NullStr)) 270 271 Runtime_Error(pszSrcFile, __LINE__, "Flesh called with pci %p pszFileName (null)", pciL); … … 856 857 857 858 #ifndef WaitFleshWorkListEmpty // 2015-08-03 SHL FIXME debug 858 VOID WaitFleshWorkListEmpty(PCSZ pszDirName )859 VOID WaitFleshWorkListEmpty(PCSZ pszDirName, ULONG ulSleep) 859 860 #else 860 VOID WaitFleshWorkListEmptyDbg(PCSZ pszDirName, PCSZ pszSrcFile_, UINT uSrcLineNo_)861 VOID WaitFleshWorkListEmptyDbg(PCSZ pszDirName, ULONG ulSleep, PCSZ pszSrcFile_, UINT uSrcLineNo_) 861 862 #endif 862 863 { … … 933 934 if (!item) { 934 935 if (waited) 935 DosSleep( fExpandAll ? 1 : 240); // Let PM do some work936 DosSleep(ulSleep); // Let PM do some work 936 937 break; // Dependents gone from work list 937 938 } 938 939 } // if pszDirName 939 DosSleep( fExpandAll ? 10 : 250);940 DosSleep(ulSleep); 940 941 } // for 941 942 -
trunk/dll/flesh.h
r1863 r1874 12 12 19 Aug 15 SHL Allow WaitFleshWorkListEmpty to wait for dependent items 13 13 22 Aug 15 GKY Remove recurse scan code. 14 27 Sep 15 GKY DosSleep times in WaitFleshWorkListEmpty set by caller 14 15 15 16 ***********************************************************************/ … … 27 28 28 29 #if 0 // 2015-08-03 SHL FIXME debug 29 VOID WaitFleshWorkListEmpty(PCSZ pszDirName );30 VOID WaitFleshWorkListEmpty(PCSZ pszDirName, ULONG ulSleep); 30 31 #else 31 #define WaitFleshWorkListEmpty(pszDirName ) WaitFleshWorkListEmptyDbg(pszDirName, __FILE__, __LINE__)32 VOID WaitFleshWorkListEmptyDbg(PCSZ pszDirName, PCSZ pszSrcFile, UINT uSrcLineNo);32 #define WaitFleshWorkListEmpty(pszDirName, ulSleep) WaitFleshWorkListEmptyDbg(pszDirName, ulSleep, __FILE__, __LINE__) 33 VOID WaitFleshWorkListEmptyDbg(PCSZ pszDirName, ULONG ulSleep, PCSZ pszSrcFile, UINT uSrcLineNo); 33 34 #endif 34 35 -
trunk/dll/select.c
r1873 r1874 39 39 work with Flesh, Stubby and UnFlesh being moved to a thread 40 40 26 Sep 15 GKY Changes to speed up ExpandAll 41 27 Sep 15 GKY DosSleep times in WaitFleshWorkListEmpty set by caller 41 42 42 43 ***********************************************************************/ … … 600 601 DosSleep(0); // Yield to EXPANDTREE and Flesh thread 601 602 if (!IsFleshWorkListEmpty()) { 602 WaitFleshWorkListEmpty(NULL ); // Let it expand603 WaitFleshWorkListEmpty(NULL, 10); // Let it expand 603 604 } 604 605 } … … 606 607 while (pci && (INT)pci != -1) { 607 608 ExpandAll(hwndCnr, count, pci); 608 if ( !IsFleshWorkListEmpty())609 WaitFleshWorkListEmpty(NULL ); // Wait for container to catch up609 if (count != 0 && !IsFleshWorkListEmpty()) 610 WaitFleshWorkListEmpty(NULL, 10); // Wait for container to catch up 610 611 pci = (PCNRITEM) WinSendMsg(hwndCnr, CM_QUERYRECORD, MPFROMP(pci), 611 612 MPFROM2SHORT(CMA_NEXT, CMA_ITEMORDER)); -
trunk/dll/treecnr.c
r1873 r1874 112 112 26 Sep 15 GKY Remove fInitialDriveScan code 113 113 26 Sep 15 GKY Changes to speed up ExpandAll 114 26 Sep 15 GKY Put UM_TOPDIR in the object window so it can call WaitFleshWorkListEmpty 115 while avoiding thread 1 116 27 Sep 15 GKY DosSleep times in WaitFleshWorkListEmpty set by caller 114 117 115 118 ***********************************************************************/ … … 353 356 if (!pciP || (INT)pciP == -1) { 354 357 //DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(\"%s\") returned pciP %p", szDir, pciP); // 2015-08-04 SHL FIXME debug 355 WaitFleshWorkListEmpty(szDirArg ); // 2015-08-23 SHL358 WaitFleshWorkListEmpty(szDirArg, 240); // 2015-08-23 SHL 356 359 break; // No match 357 360 } … … 385 388 } 386 389 } 387 WaitFleshWorkListEmpty(NULL ); // 2015-09-26 GKY Let Flesh thread catch up390 WaitFleshWorkListEmpty(NULL, 240); // 2015-09-26 GKY Let Flesh thread catch up 388 391 } // while expanding 389 392 … … 396 399 if (~pci->rc.flRecordAttr & CRA_CURSORED) { 397 400 if (collapsefirst) { 398 WaitFleshWorkListEmpty(NULL );401 WaitFleshWorkListEmpty(NULL, 240); 399 402 pciP = WinSendMsg(hwndCnr, 400 403 CM_QUERYRECORD, … … 441 444 if (maketop || fTopDir) { 442 445 if (fCollapseFirst && !quickbail) { 443 WaitFleshWorkListEmpty(NULL ); //Let the root expand first otherwise it makes top446 WaitFleshWorkListEmpty(NULL, 240); //Let the root expand first otherwise it makes top 444 447 } 445 448 // 2015-08-23 SHL FIXME debug … … 449 452 450 453 if (!quickbail) { 451 WaitFleshWorkListEmpty(szDirArg ); // 2015-08-19 SHL try to ensure contents stable454 WaitFleshWorkListEmpty(szDirArg, 240); // 2015-08-19 SHL try to ensure contents stable 452 455 //DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED) szDirArg \"%s\"", szDirArg); // 2015-08-04 SHL FIXME debug 453 456 WinSendMsg(hwndCnr, … … 771 774 return 0; 772 775 776 case UM_TOPDIR: 777 if (mp1) { 778 dcd = INSTDATA(hwnd); 779 if (dcd) { 780 PCNRITEM pci = (PCNRITEM) mp1; 781 WaitFleshWorkListEmpty(pci->pszFileName, 240); 782 ShowCnrRecord(dcd->hwndCnr, (PMINIRECORDCORE) pci); 783 } 784 } 785 return 0; 786 773 787 case DM_PRINTOBJECT: 774 788 return MRFROMLONG(DRR_TARGET); … … 813 827 x++; 814 828 if (!IsFleshWorkListEmpty()) { 815 WaitFleshWorkListEmpty(NULL ); // Let it expand829 WaitFleshWorkListEmpty(NULL, 10); // Let it expand 816 830 } 817 831 fExpanding = ExpandAll(dcd->hwndCnr, x, (PCNRITEM) mp2); … … 967 981 pci = FindParentRecord(dcd->hwndCnr, pci); 968 982 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 969 WaitFleshWorkListEmpty(pci->pszFileName ); // 2015-08-19 SHL in case pci still in work list983 WaitFleshWorkListEmpty(pci->pszFileName, 240); // 2015-08-19 SHL in case pci still in work list 970 984 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 971 985 } … … 1959 1973 case UM_TOPDIR: 1960 1974 if (mp1) { 1961 PCNRITEM pci = (PCNRITEM) mp1; 1962 ShowCnrRecord(hwnd, (PMINIRECORDCORE) pci); 1975 PostMsg(dcd->hwndObject, UM_TOPDIR, mp1, MPVOID); 1963 1976 } 1964 1977 return 0; … … 2077 2090 else { 2078 2091 driveserial[x] = -1; 2079 //WaitFleshWorkListEmpty(NULL ); // 2015-08-13 SHL in case pci still in work list2092 //WaitFleshWorkListEmpty(NULL, 10); // 2015-08-13 SHL in case pci still in work list 2080 2093 AddFleshWorkRequest(hwnd, pci, eUnFlesh); 2081 2094 PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID); … … 3433 3446 driveserial[toupper(*pci->pszFileName) - 'A'] != 3434 3447 volser.serial) 3435 { 3436 WaitFleshWorkListEmpty(pci->pszFileName ); // 2015-08-19 SHL in case pci still in work list3448 { 3449 WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list 3437 3450 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 3438 3451 } … … 3441 3454 driveserial[toupper(*pci->pszFileName) - 'A'] != 3442 3455 volser.serial)) { 3456 WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list 3443 3457 if (qmsg.msg == UM_EXPANDTREE && AddFleshWorkRequest(dcd->hwndCnr, pci, eFlesh) 3444 && !dcd->suspendview && fTopDir && !fSwitchTreeOnDirChg) { 3445 DosSleep(1); 3446 WaitFleshWorkListEmpty(pci->pszFileName); 3458 && !dcd->suspendview && fTopDir) { 3447 3459 PostMsg(dcd->hwndCnr, UM_TOPDIR, MPFROMP(pci), MPVOID); 3448 3460 } … … 3452 3464 else { 3453 3465 driveserial[toupper(*pci->pszFileName) - 'A'] = -1; 3454 WaitFleshWorkListEmpty(pci->pszFileName ); // 2015-08-19 SHL in case pci still in work list3466 WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list 3455 3467 AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh); 3456 3468 PostMsg(dcd->hwndCnr, UM_RESCAN, MPVOID, MPVOID); … … 3466 3478 DosSleep(1); 3467 3479 else { 3468 while (!IsFleshWorkListEmpty()) 3469 DosSleep(10); //Yield to Flesh thread 3480 WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list 3470 3481 } 3471 3482 AddFleshWorkRequest(dcd->hwndCnr, pci, eFlesh); // forceFlesh 3472 if (!dcd->suspendview && fTopDir && !fSwitchTreeOnDirChg) {3483 if (!dcd->suspendview && fTopDir) { 3473 3484 //DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_TOPDIR %p pci %p %s", 3474 3485 // qmsg.hwnd, pci, pci->pszFileName); // 2015-08-04 SHL FIXME debug
Note:
See TracChangeset
for help on using the changeset viewer.