Changeset 1874 for trunk/dll/treecnr.c


Ignore:
Timestamp:
Sep 27, 2015, 7:20:10 PM (10 years ago)
Author:
Gregg Young
Message:

DosSleep times in WaitFleshWorkListEmpty set by caller; TOPDIR code calls WaitFleshWorkListEmpty before ShowCnrRecord and now actually exists for directory containers in tree view. These calls are made from the object windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/treecnr.c

    r1873 r1874  
    112112  26 Sep 15 GKY Remove fInitialDriveScan code
    113113  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
    114117
    115118***********************************************************************/
     
    353356      if (!pciP || (INT)pciP == -1) {
    354357        //DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(\"%s\") returned pciP %p", szDir, pciP); // 2015-08-04 SHL FIXME debug
    355         WaitFleshWorkListEmpty(szDirArg);       // 2015-08-23 SHL
     358        WaitFleshWorkListEmpty(szDirArg, 240);  // 2015-08-23 SHL
    356359        break;                                  // No match
    357360      }
     
    385388        }
    386389      }
    387       WaitFleshWorkListEmpty(NULL);     // 2015-09-26 GKY Let Flesh thread catch up
     390      WaitFleshWorkListEmpty(NULL, 240);     // 2015-09-26 GKY Let Flesh thread catch up
    388391    } // while expanding
    389392
     
    396399    if (~pci->rc.flRecordAttr & CRA_CURSORED) {
    397400      if (collapsefirst) {
    398         WaitFleshWorkListEmpty(NULL);
     401        WaitFleshWorkListEmpty(NULL, 240);
    399402        pciP = WinSendMsg(hwndCnr,
    400403                          CM_QUERYRECORD,
     
    441444      if (maketop || fTopDir) {
    442445        if (fCollapseFirst && !quickbail) {
    443           WaitFleshWorkListEmpty(NULL); //Let the root expand first otherwise it makes top
     446          WaitFleshWorkListEmpty(NULL, 240); //Let the root expand first otherwise it makes top
    444447        }
    445448        // 2015-08-23 SHL FIXME debug
     
    449452
    450453      if (!quickbail) {
    451         WaitFleshWorkListEmpty(szDirArg);       // 2015-08-19 SHL try to ensure contents stable
     454        WaitFleshWorkListEmpty(szDirArg, 240);  // 2015-08-19 SHL try to ensure contents stable
    452455        //DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED) szDirArg \"%s\"", szDirArg); // 2015-08-04 SHL FIXME debug
    453456        WinSendMsg(hwndCnr,
     
    771774    return 0;
    772775
     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
    773787  case DM_PRINTOBJECT:
    774788    return MRFROMLONG(DRR_TARGET);
     
    813827          x++;
    814828          if (!IsFleshWorkListEmpty()) {
    815             WaitFleshWorkListEmpty(NULL); // Let it expand
     829            WaitFleshWorkListEmpty(NULL, 10); // Let it expand
    816830          }
    817831          fExpanding = ExpandAll(dcd->hwndCnr, x, (PCNRITEM) mp2);
     
    967981            pci = FindParentRecord(dcd->hwndCnr, pci);
    968982            driveserial[toupper(*pci->pszFileName) - 'A'] = -1;
    969             WaitFleshWorkListEmpty(pci->pszFileName);   // 2015-08-19 SHL in case pci still in work list
     983            WaitFleshWorkListEmpty(pci->pszFileName, 240);      // 2015-08-19 SHL in case pci still in work list
    970984            AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh);
    971985          }
     
    19591973  case UM_TOPDIR:
    19601974    if (mp1) {
    1961       PCNRITEM pci = (PCNRITEM) mp1;
    1962       ShowCnrRecord(hwnd, (PMINIRECORDCORE) pci);
     1975      PostMsg(dcd->hwndObject, UM_TOPDIR, mp1, MPVOID);
    19631976    }
    19641977    return 0;
     
    20772090          else {
    20782091            driveserial[x] = -1;
    2079             //WaitFleshWorkListEmpty(NULL);     // 2015-08-13 SHL in case pci still in work list
     2092            //WaitFleshWorkListEmpty(NULL, 10); // 2015-08-13 SHL in case pci still in work list
    20802093            AddFleshWorkRequest(hwnd, pci, eUnFlesh);
    20812094            PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
     
    34333446                    driveserial[toupper(*pci->pszFileName) - 'A'] !=
    34343447                    volser.serial)
    3435                 { 
    3436                   WaitFleshWorkListEmpty(pci->pszFileName);     // 2015-08-19 SHL in case pci still in work list
     3448                {
     3449                  WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list
    34373450                  AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh);
    34383451                }
     
    34413454                     driveserial[toupper(*pci->pszFileName) - 'A'] !=
    34423455                     volser.serial)) {
     3456                  WaitFleshWorkListEmpty(pci->pszFileName, 10); // 2015-08-19 SHL in case pci still in work list
    34433457                  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) {
    34473459                    PostMsg(dcd->hwndCnr, UM_TOPDIR, MPFROMP(pci), MPVOID);
    34483460                  }
     
    34523464              else {
    34533465                driveserial[toupper(*pci->pszFileName) - 'A'] = -1;
    3454                 WaitFleshWorkListEmpty(pci->pszFileName);       // 2015-08-19 SHL in case pci still in work list
     3466                WaitFleshWorkListEmpty(pci->pszFileName, 10);   // 2015-08-19 SHL in case pci still in work list
    34553467                AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh);
    34563468                PostMsg(dcd->hwndCnr, UM_RESCAN, MPVOID, MPVOID);
     
    34663478                DosSleep(1);
    34673479              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
    34703481              }
    34713482              AddFleshWorkRequest(dcd->hwndCnr, pci, eFlesh);   // forceFlesh
    3472               if (!dcd->suspendview && fTopDir && !fSwitchTreeOnDirChg) {
     3483              if (!dcd->suspendview && fTopDir) {
    34733484                //DbgMsg(pszSrcFile, __LINE__, "TreeCnrWndProc UM_TOPDIR %p pci %p %s",
    34743485                //       qmsg.hwnd, pci, pci->pszFileName);  // 2015-08-04 SHL FIXME debug
Note: See TracChangeset for help on using the changeset viewer.