Changeset 1858


Ignore:
Timestamp:
Aug 20, 2015, 7:31:14 AM (10 years ago)
Author:
Steven Levine
Message:

Rework FlestWaitForWorkListEmpty to support wait for parents of path
Clean up some obsolete code

Location:
trunk/dll
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/dircnrs.c

    r1856 r1858  
    909909          // Keep drive tree in sync with directory container
    910910          PSZ pszTempDir;
    911 #if 0 // 2015-08-12 SHL FIXME to be gone fInitialDriveScan
    912           while (fInitialDriveScan)
    913             DosSleep(500);                      // Allow to complete
    914           DosSleep(200);                        // Allow to complete
    915 #endif
    916911          pszTempDir = xstrdup(dcd->directory, pszSrcFile, __LINE__);
    917912          if (pszTempDir) {
  • trunk/dll/flesh.c

    r1856 r1858  
    77
    88  Copyright (c) 1993-98 M. Kimes
    9   Copyright (c) 2005-2015 Steven H. Levine
     9  Copyright (c) 2005, 2015 Steven H. Levine
    1010
    1111  24 May 05 SHL Rework Win_Error usage
     
    3535  03 Aug 15 SHL Document Stubby a bit better
    3636  07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh
     37  19 Aug 15 SHL Allow WaitFleshWorkListEmpty to wait for dependent items
    3738
    3839***********************************************************************/
     
    9495BOOL Stubby(HWND hwndCnr, PCNRITEM pciParent);
    9596BOOL FleshEnv(HWND hwndCnr, PCNRITEM pciParent);
    96 BOOL UnFlesh(HWND hwndCnr, PCNRITEM pciParent);
     97VOID UnFlesh(HWND hwndCnr, PCNRITEM pciParent);
    9798
    9899/**
     
    110111    fullpath[CCHMAXPATH + 12], *env, *p, *pp, *var = NULL;
    111112
    112   if (!pciParent || (INT) pciParent == -1 || !hwndCnr)
     113  if (!pciParent || (INT)pciParent == -1 || !hwndCnr)
    113114    return FALSE;
    114115
     
    155156                                 fullpath, pciParent, FALSE, FALSE, FALSE);
    156157            if (pciL) {
    157               while (pciL && pciL != (PCNRITEM) - 1 && pciL != pciParent)
     158              while (pciL && pciL != (PCNRITEM)-1 && pciL != pciParent)
    158159                pciL = WinSendMsg(hwndCnr,
    159160                                  CM_QUERYRECORD,
     
    183184                memset(&ri, 0, sizeof(ri));
    184185                ri.cb = sizeof(ri);
    185                 ri.pRecordOrder = (PRECORDCORE) CMA_END;
    186                 ri.pRecordParent = (PRECORDCORE) pciParent;
    187                 ri.zOrder = (ULONG) CMA_TOP;
     186                ri.pRecordOrder = (PRECORDCORE)CMA_END;
     187                ri.pRecordParent = (PRECORDCORE)pciParent;
     188                ri.zOrder = (ULONG)CMA_TOP;
    188189                ri.cRecordsInsert = 1;
    189190                ri.fInvalidateRecord = FALSE;
     191                // 2015-08-03 SHL FIXME debug
     192                if (pciL->pszFileName == NullStr)
     193                  DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pciL, pciL->pszFileName); // 2015-08-03 SHL FIXME debug
    190194                if (!WinSendMsg(hwndCnr,
    191195                                CM_INSERTRECORD, MPFROMP(pciL), MPFROMP(&ri)))
     
    198202    }
    199203    xfree(var, pszSrcFile, __LINE__);
    200     pciL = (PCNRITEM) WinSendMsg(hwndCnr,
    201                                  CM_QUERYRECORD,
    202                                  MPFROMP(pciParent),
    203                                  MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
    204     while (pciL && (INT) pciL != -1) {
     204    pciL = (PCNRITEM)WinSendMsg(hwndCnr,
     205                                CM_QUERYRECORD,
     206                                MPFROMP(pciParent),
     207                                MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
     208    while (pciL && (INT)pciL != -1) {
    205209      pciL->flags |= (RECFLAGS_NODRAG | RECFLAGS_UNDERENV);
    206210      WinSendMsg(hwndCnr,
     
    230234    return FALSE;
    231235
    232   // 2015-08-13 SHL FIXME to optimize
    233   if (fAmClosing) {
    234     // Can jiggle - see MainWndProc WM_CLOSE
    235     DosSleep(100);
    236     if (fAmClosing)
    237       return FALSE;                     // time to die
    238   }
     236  // 2015-08-13 SHL
     237  if (fAmQuitting)
     238    return FALSE;
    239239
    240240  // 2015-08-03 SHL FIXME debug
     
    253253
    254254  // 2015-08-06 SHL allow pciL -1
     255  // 2015-08-06 SHL FIXME to not need pszFileName check
    255256  if (!pciL || (INT)pciL == -1 || !*pciL->pszFileName) {
    256257
    257258    // No children or filename null
    258     // 2015-08-06 SHL FIXME to know how this can happen
    259259    if (pciL && (INT)pciL != -1) {
    260       // 2015-08-06 SHL FIXME to loop and timeout if Stubby threads working
     260      // 2015-08-06 SHL FIXME to ensure this an not happen
     261      // if (!*pciL->pszFileName)
     262        // Runtime_Error(pszSrcFile, __LINE__, "Flesh called with pci %p pszFileName (null)", pciL);
     263
    261264      if (!fNoFleshDbgMsg)
    262         DbgMsg(pszSrcFile, __LINE__, "Flesh RemoveCnrItems() pciL %p", pciL); // 2015-08-04 SHL FIXME debug
     265        DbgMsg(pszSrcFile, __LINE__, "Flesh RemoveCnrItems() pciL %p \"%s\"",
     266               pciL,
     267               pciL->pszFileName ? pciL->pszFileName : "(null)"); // 2015-08-04 SHL FIXME debug
     268      // Assume refernces to pciL already removed from work list
    263269      RemoveCnrItems(hwndCnr, pciL, 1, CMA_FREE);
    264270    }
     
    268274      dcd = NULL;
    269275
    270     // DbgMsg(pszSrcFile, __LINE__, "Flesh %s dcd %p called by %s#%u", pciParent->pszFileName, dcd, pszSrcFile_, uSrcLineNo_); // 2015-08-03 SHL FIXME debug
    271 
    272     // 2015-08-06 SHL FIXME to not trap here
    273276    includefiles =
    274277      driveflags[toupper(*pciParent->pszFileName) - 'A'] & DRIVE_INCLUDEFILES ?
     
    293296}
    294297
    295 // 2015-08-06 SHL FIXME to be VOID
    296 
    297 BOOL UnFlesh(HWND hwndCnr, PCNRITEM pciParent)
     298/**
     299 * Remove children from container
     300 * @parame pciParent is parent of children to be removed
     301 */
     302
     303VOID UnFlesh(HWND hwndCnr, PCNRITEM pciParent)
    298304{
    299305  BOOL removed = FALSE;
     
    301307
    302308  if (!pciParent || !hwndCnr)
    303     return FALSE;
     309    return;
    304310
    305311  if (!fNoFleshDbgMsg)
     
    307313
    308314  for (;;) {
    309     pciL = (PCNRITEM) WinSendMsg(hwndCnr,
    310                                  CM_QUERYRECORD,
    311                                  MPFROMP(pciParent),
    312                                  MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
     315    pciL = (PCNRITEM)WinSendMsg(hwndCnr,
     316                                CM_QUERYRECORD,
     317                                MPFROMP(pciParent),
     318                                MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
    313319    if (!pciL || (INT)pciL == -1)
    314320      break;                    // Done
     
    326332               MPFROM2SHORT(1, CMA_ERASE | CMA_REPOSITION));
    327333  }
    328   return removed;
     334  return;
    329335}
    330336
     
    353359  HDIR hDir = HDIR_CREATE;
    354360  ULONG nm, ulM = 1, total = 0, fl;
    355   CHAR str[CCHMAXPATH];
     361  CHAR wildcard[CCHMAXPATH];
    356362  register INT len;
    357363  APIRET rc, prc;
    358   BOOL isadir = FALSE, isremote, includefiles;
     364  BOOL isadir = FALSE;
     365  BOOL isremote;
     366  BOOL includefiles;
    359367  ULONG ddepth = DDEPTH;
    360368  ULONG drvNum;
     
    362370  static BOOL brokenlan = FALSE, isbroken = FALSE;
    363371
    364   if (!pciParent || (INT) pciParent == -1 || !*pciParent->pszFileName
     372  if (!pciParent || (INT)pciParent == -1 || !*pciParent->pszFileName
    365373      || pciParent->pszFileName == NullStr || !hwndCnr)
    366374    return FALSE;
     
    371379  // Build wildcard
    372380  len = strlen(pciParent->pszFileName);
    373   memcpy(str, pciParent->pszFileName, len + 1);
    374   if (str[len - 1] != '\\')
    375     str[len++] = '\\';
    376   str[len++] = '*';
    377   str[len] = 0;
    378 
    379   if (!isalpha(*str) || str[1] != ':' || str[2] != '\\')
    380     MakeFullName(str);
     381  memcpy(wildcard, pciParent->pszFileName, len + 1);
     382  if (wildcard[len - 1] != '\\')
     383    wildcard[len++] = '\\';
     384  wildcard[len++] = '*';
     385  wildcard[len] = 0;
     386
     387  // 2015-08-19 SHL FIXME to know how this can happen
     388  if (!isalpha(*wildcard) || wildcard[1] != ':' || wildcard[2] != '\\') {
     389    MakeFullName(wildcard);
     390    DbgMsg(pszSrcFile, __LINE__, "Stubby MakeFullName returned %s", wildcard); // 2015-08-19 SHL FIXME debug
     391  }
    381392
    382393  drvNum = toupper(*pciParent->pszFileName) - 'A';
    383394  flags = driveflags[drvNum];
    384   if (!isalpha(*str) ||
    385       str[1] != ':' ||
    386       str[2] != '\\' || ((flags & DRIVE_IGNORE)))
     395  if (!isalpha(*wildcard) ||
     396      wildcard[1] != ':' ||
     397      wildcard[2] != '\\' || ((flags & DRIVE_IGNORE)))
    387398    return FALSE;                       // Not a directory or ignore requested
    388399
     
    394405    if (fRemoteBug) {
    395406      if (brokenlan) {
    396         ddepth = (ULONG) - 1;
     407        ddepth = (ULONG)-1;
    397408        ddepth--;
    398409      }
     
    412423  fl = includefiles ? FILE_DIRECTORY : MUST_HAVE_DIRECTORY;
    413424
    414   rc = DosFindFirst(str,
     425  DbgMsg(pszSrcFile, __LINE__, "Stubby DosFindFirst(%s)", wildcard); // 2015-08-19 SHL FIXME debug
     426
     427  rc = DosFindFirst(wildcard,
    415428                    &hDir,
    416429                    FILE_NORMAL | fl |
     
    425438        // Find returned file when only directories requested
    426439        brokenlan = TRUE;
    427         ddepth = (ULONG) - 1;
     440        ddepth = (ULONG)-1;
    428441        ddepth--;
    429442        if (!NoBrokenNotify) {
     
    477490              total, toupper(*pciParent->pszFileName));
    478491      if (rc && rc != ERROR_NO_MORE_FILES)
    479         sprintf(&s[strlen(s)], GetPString(IDS_SEARCHERRORTEXT), rc, str);
     492        sprintf(&s[strlen(s)], GetPString(IDS_SEARCHERRORTEXT), rc, wildcard);
    480493      else if (ddepth < 16)
    481494        brokenlan = TRUE;
     
    502515                           isremote ? GetPString(IDS_REMOTETEXT) :
    503516                                      GetPString(IDS_LOCALTEXT),
    504                            *str);
     517                           *wildcard);
    505518              if (prc == MBID_NO) {
    506519                saymsg(MB_ENTER,
     
    551564          else {
    552565            RECORDINSERT ri;
    553             pci->pszFileName = NullStr;
    554             pci->pszDisplayName = pci->pszFileName;
     566            // 2015-08-19 SHL FIXME to use BldFullPathName(wildcard, ...)
     567            pci->pszFileName = NullStr; // 2015-08-19 SHL FIXME to doc why
     568            pci->pszDisplayName = NullStr;
    555569            pci->rc.pszIcon = pci->pszDisplayName;
    556570            memset(&ri, 0, sizeof(RECORDINSERT));
    557571            ri.cb = sizeof(RECORDINSERT);
    558             ri.pRecordOrder = (PRECORDCORE) CMA_END;
    559             ri.pRecordParent = (PRECORDCORE) pciParent;
    560             ri.zOrder = (ULONG) CMA_TOP;
     572            ri.pRecordOrder = (PRECORDCORE)CMA_END;
     573            ri.pRecordParent = (PRECORDCORE)pciParent;
     574            ri.zOrder = (ULONG)CMA_TOP;
    561575            ri.cRecordsInsert = 1;
    562576            ri.fInvalidateRecord = TRUE;
    563             // DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD %p \"%s\" %.255s", pci, pci->pszFileName, pffb->achName); // 2015-08-03 SHL FIXME debug
     577             // 2015-08-03 SHL FIXME debug
     578            if (pci->pszFileName == NullStr)
     579              DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD %p \"%s\" %.255s", pci, pci->pszFileName, pffb->achName);
    564580            if (!WinSendMsg(hwndCnr,
    565581                            CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) {
     
    568584              WinSetFocus(HWND_DESKTOP, hwndCnr);
    569585              if (WinIsWindow((HAB)0, hwndCnr)) {
    570                 if (!fNoFleshDbgMsg)
    571                   DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName %s", pci, pci->pszFileName); // 2015-08-03 SHL FIXME debug
     586                if (!fNoFleshDbgMsg) {
     587                  // 2015-08-03 SHL FIXME debug
     588                  if (pci->pszFileName == NullStr)
     589                    DbgMsg(pszSrcFile, __LINE__, "Stubby CM_INSERTRECORD pci %p pszFileName \"%s\"", pci, pci->pszFileName); // 2015-08-03 SHL FIXME debug
     590                }
    572591                if (!WinSendMsg(hwndCnr,
    573592                                CM_INSERTRECORD, MPFROMP(pci), MPFROMP(&ri))) {
     
    585604        }
    586605      } // if isadir
    587       else if (toupper(*str) > 'B' && str[1] == ':' && str[2] == '\\' &&
    588                !str[3]) {
    589 
     606      else if (toupper(*wildcard) > 'B' && wildcard[1] == ':' && wildcard[2] == '\\' &&
     607               !wildcard[3]) {
     608
     609        // 2015-08-19 SHL FIXME to know how this can happen since wildcard ends with *
    590610        // Is root and no subdirectories
    591611        CHAR s[162];
     612        DbgMsg(pszSrcFile, __LINE__, "Stubby !isadir for %s", wildcard); // 2015-08-19 SHL FIXME debug
    592613        sprintf(s,
    593614                GetPString(IDS_NOSUBDIRS2TEXT),
     
    599620    }
    600621  }
    601   else if (toupper(*str) > 'B' && rc != ERROR_NO_MORE_FILES) {
     622  else if (toupper(*wildcard) > 'B' && rc != ERROR_NO_MORE_FILES) {
    602623    // Find for remote or hard drive failed with error
    603624    CHAR s[CCHMAXPATH + 80];
    604     sprintf(s, GetPString(IDS_SEARCHERRORTEXT), rc, str);
     625    sprintf(s, GetPString(IDS_SEARCHERRORTEXT), rc, wildcard);
    605626    Notify(s);
    606627  }
     
    629650
    630651/**
    631  * Check pci matches
     652 * Check work list item pci matches passed pci
    632653 */
    633654
     
    679700  item->action= action;
    680701
    681   if (fAmClosing) {
    682     // Can jiggle - see MainWndProc WM_CLOSE
    683     DosSleep(100);
    684     if (fAmClosing)
    685       return FALSE;
    686   }
     702  if (fAmQuitting)
     703    return FALSE;
    687704
    688705  // 2015-08-03 SHL FIXME debug
     706#if 0 // 2015-08-13 SHL FIXME to be gone
    689707  {
    690 #if 0 // 2015-08-13 SHL FIXME to be gone
    691708    static PSZ itemNames[] = {
    692709            "eStubby", "eFlesh", "eFleshEnv", "eUnFlesh"
     
    698715             itemNames[item->action],
    699716             pci,
    700              pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug
     717             pszSrcFile_, uSrcLineNo);
    701718    }
    702719    else if (!pci->pszFileName) {
     
    704721             itemNames[item->action],
    705722             pci,
    706              pszSrcFile_, uSrcLineNo); // 2015-08-03 SHL FIXME debug
     723             pszSrcFile_, uSrcLineNo);
    707724    }
    708725    else if (!fNoFleshDbgMsg) {
     
    717734      Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest call with action %s pci %p",
    718735             itemNames[item->action],
    719              pci); // 2015-08-03 SHL FIXME debug
     736             pci);
    720737    }
    721738    else if (!pci->pszFileName) {
    722739      Runtime_Error(pszSrcFile, __LINE__, "AddFleshWorkRequest called with action %s pci %p pszFileName (null)",
    723740             itemNames[item->action],
    724              pci); // 2015-08-03 SHL FIXME debug
     741             pci);
    725742    }
    726743    else if (!fNoFleshDbgMsg) {
     
    731748    }
    732749#endif
     750  }
    733751#endif
    734   }
    735752
    736753  rc = DosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT);
     
    738755    Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem");
    739756
    740   // 2015-08-13 SHL FIXME to be done
    741757  // Delete stale requests
    742   if (item->action == eUnFlesh) {
     758  if (item->action == eUnFlesh)
    743759    DeleteStaleFleshWorkListItems(pci);
    744   }
    745760
    746761  List2Append(&FleshWorkList, (PLIST2)item);
     
    768783
    769784/**
    770  * Wait until work list empty
     785 * Check if pci pathname is parent of child path name
     786 * @param data is child path name
     787 * @return TRUE if is parent
     788 */
     789
     790BOOL IsParentOfChildPath(PLIST2 item, PVOID data)
     791{
     792  UINT c;
     793  if (!((PFLESHWORKITEM)item)->pci->pszFileName) {
     794    Runtime_Error(pszSrcFile, __LINE__, "MatchesFocusDrive called with pci %p pszFileName (null) by %s:%u", ((PFLESHWORKITEM)item)->pci);
     795    return FALSE;
     796  }
     797  c = strlen(((PFLESHWORKITEM)item)->pci->pszFileName);
     798  return strncmp(((PFLESHWORKITEM)item)->pci->pszFileName, (PCSZ)data, c) == 0;
     799}
     800
     801/**
     802 * Wait until work list empty or until dependent items removed from list
    771803 * Advisory only
     804 * @parse pszFileName is dependent pathName
    772805 */
    773806
    774807#if 0 // 2015-08-03 SHL FIXME debug
    775 VOID WaitFleshWorkListEmpty()
     808VOID WaitFleshWorkListEmpty(PCSZ pszFileName)
    776809#else
    777 VOID WaitFleshWorkListEmptyDbg(PCSZ pszSrcFile_, UINT uSrcLineNo_)
     810VOID WaitFleshWorkListEmptyDbg(PCSZ pszFileName, PCSZ pszSrcFile_, UINT uSrcLineNo_)
    778811#endif
    779812{
     813  APIRET rc;
     814  PFLESHWORKITEM item;
    780815  INT tid = GetTidForThread();
     816  CHAR chSavedFleshFocusDrive = chFleshFocusDrive;
    781817
    782818  if (tid == 1 || tid == tidFleshWorkListThread) {
     
    790826  else if (IsFleshWorkListEmpty()) {
    791827#   ifdef WaitFleshWorkListEmpty
    792     DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist empty by tid %u at %s:%u", tid, pszSrcFile_, uSrcLineNo_);
     828    DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with worklist empty at %s:%u", pszSrcFile_, uSrcLineNo_);
    793829#   else
    794     DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list empty by tid %u", tid);
     830    DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list empty");
    795831#   endif
    796832  }
     
    798834  // Can not wait if call from thread 1 or FleshWorkListThread
    799835  while (!IsFleshWorkListEmpty()) {
     836
     837#if 0 // 2015-08-19 SHL FIXME debug
    800838#   ifdef WaitFleshWorkListEmpty
    801839    if (!fNoFleshDbgMsg)
    802       // DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty by %s:%u", pszSrcFile_, uSrcLineNo_); // 2015-08-07 SHL FIXME debug
     840      DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty by %s:%u", pszSrcFile_, uSrcLineNo_); // 2015-08-07 SHL FIXME debug
    803841#   else
    804842    if (!fNoFleshDbgMsg)
    805       // DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty"); // 2015-08-07 SHL FIXME debug
     843      DbgMsg(pszSrcFile, __LINE__, "WaitFleshWorkListEmpty called with work list not empty"); // 2015-08-07 SHL FIXME debug
    806844#   endif
    807     // 2015-08-13 SHL FIXME to optimize
    808     if (fAmClosing) {
    809       // Can jiggle - see MainWndProc WM_CLOSE
    810       DosSleep(100);
    811       if (fAmClosing)
    812         return;
     845#endif // 2015-08-19 SHL        FIXME debug
     846
     847    // 2015-08-13 SHL
     848    if (fAmQuitting)
     849      return;
     850
     851    // Just wait for dependents if path name given
     852    if (pszFileName) {
     853      rc = DosRequestMutexSem(hmtxFleshWork, SEM_INDEFINITE_WAIT);
     854      if (rc) {
     855        Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem");
     856        continue;
     857      }
     858
     859      chFleshFocusDrive = *pszFileName;         // Give priority to work on this drive
     860
     861      item = (PFLESHWORKITEM)List2Search(&FleshWorkList, IsParentOfChildPath, (PVOID)pszFileName);
     862
     863      rc = DosReleaseMutexSem(hmtxFleshWork);
     864      if (rc)
     865        Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosReleaseMutexSem");
     866
     867      if (!item)
     868        break;                          // Dependents gone from work list
    813869    }
    814870    DosSleep(250);
    815   }
     871  } // while
     872
     873  chFleshFocusDrive = chSavedFleshFocusDrive;   // In case overridden
     874
    816875}
    817876
     
    868927      priority_normal();
    869928
    870       // 2015-08-07 SHL FIXME to know when to terminate
    871       // process list entries forever
    872       for (;;) {
     929      // process list entries until time to die
     930      for (;!fAmQuitting;) {
    873931
    874932        PFLESHWORKITEM item;
    875 
    876         // 2015-08-13 SHL FIXME to optimize
    877         if (fAmClosing) {
    878           // Can jiggle - see MainWndProc WM_CLOSE
    879           DosSleep(100);
    880           if (fAmClosing)
    881             break;                      // time to die
    882         }
    883933
    884934        // 2015-08-07 SHL FIXME to use SMPSafe...
     
    907957          Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosReleaseMutexSem");
    908958
    909         // 2015-08-07 SHL FIXME to have event sem
     959        // Wait for new items to be added to list
    910960        if (!item) {
    911961          ULONG ul;
     
    9571007            // DbgMsg(pszSrcFile, __LINE__, "FleshWorkThread pci %p pszFileName %s", stubbyArgs->pci, stubbyArgs->pci->pszFileName); // 2015-08-03 SHL FIXME debug
    9581008            flags = driveflags[toupper(*item->pci->pszFileName) - 'A'];
    959 
    960 #if 0 // 2015-08-07 SHL FIXME to be gone
    961             if (flags & DRIVE_LOCALHD) {
    962               // Serialize to prevent head thrashing
    963               rc = DosRequestMutexSem(hmtxScanningLocalHD, SEM_INDEFINITE_WAIT);
    964               if (rc)
    965                 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem");
    966             }
    967 #endif
    9681009
    9691010#if 1
     
    9951036            // Drop through to eFlesh
    9961037
    997 
    998 #if 0 // 2015-08-07 SHL FIXME to be gone
    999             if (flags & DRIVE_LOCALHD) {
    1000               rc = DosReleaseMutexSem(hmtxScanningLocalHD);
    1001               if (rc) {
    1002                 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    1003                           "DosReleaseMutexSem(hmtxScanningLocalHD)");
    1004               }
    1005             }
    1006 #endif // 2015-08-07 SHL FIXME to be gone
    1007 
    1008             // Drop through
    10091038          case eFlesh:
    10101039            if (Flesh(item->hwndCnr, item->pci)) {
     
    10321061  // DbgMsg(pszSrcFile, __LINE__, "ProcessDirCount %i FixedVolume %i", ProcessDirCount, FixedVolume);
    10331062  if (ProcessDirCount >= FixedVolume) {
    1034 
    1035 #if 0 // 2015-08-04 SHL FIXME to be gone
    1036     rc = DosReleaseMutexSem(hmtxScanning);
    1037     if (rc)
    1038       Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosReleaseMutexSem");
    1039 #endif // 2015-08-04 SHL FIXME to be gone
    1040 
    1041 #if 0 // 2015-08-04 SHL FIXME to be gone
    1042     rc = DosPostEventSem(hevTreeCnrScanComplete);
    1043     if (rc && rc != ERROR_ALREADY_POSTED)
    1044       Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    1045 #endif // 2015-08-04 SHL FIXME to be gone
    1046 
    10471063    ProcessDirCount = 0;
    10481064    FixedVolume = 0;
  • trunk/dll/flesh.h

    r1856 r1858  
    1010
    1111  07 Aug 15 SHL Rework to use AddFleshWorkRequest rather than direct calls to Stubby/Flesh/Unflesh
     12  19 Aug 15 SHL Allow WaitFleshWorkListEmpty to wait for dependent items
    1213
    1314***********************************************************************/
     
    2728VOID WaitFleshWorkListEmpty();
    2829#else
    29 #define WaitFleshWorkListEmpty() WaitFleshWorkListEmptyDbg(__FILE__, __LINE__)
    30 VOID WaitFleshWorkListEmptyDbg(PCSZ pszSrcFile, UINT uSrcLineNo);
     30#define WaitFleshWorkListEmpty(pszFileName) WaitFleshWorkListEmptyDbg(pszFileName, __FILE__, __LINE__)
     31VOID WaitFleshWorkListEmptyDbg(PCSZ pszFileName, PCSZ pszSrcFile, UINT uSrcLineNo);
    3132#endif
    3233
  • trunk/dll/init.c

    r1856 r1858  
    135135  12 Aug 15 JBS Ticket #524: Ensure no "highmem-unsafe" functions are called directly
    136136                Calls to unsafe Dos... functions have been changed to call the wrapped xDos... functions
     137  19 Aug 15 SHL Delete obsoletes
    137138
    138139***********************************************************************/
     
    239240HMTX hmtxFM2Globals;
    240241
    241 #if 0 // 2015-08-04 SHL FIXME to be gone
    242 HMTX hmtxScanning;
    243 #endif // 2015-08-04 SHL FIXME to be gone
    244 
    245 #if 0 // 2015-08-07 SHL FIXME to be gone
    246 HMTX hmtxScanningLocalHD;
    247 #endif // 2015-08-07 SHL FIXME to be gone
    248 
    249242HMTX hmtxFiltering;
    250 
    251 #if 0 // 2015-08-04 SHL FIXME to be gone
    252 HEV  hevTreeCnrScanComplete;
    253 #endif // 2015-08-04 SHL FIXME to be gone
    254243
    255244ULONG OS2ver[2];
     
    11871176              PCSZ_DOSCREATEMUTEXSEM);
    11881177  }
    1189 #if 0 // 2015-08-04 SHL FIXME to be gone
    1190   if (DosCreateMutexSem(NULL, &hmtxScanning, 0L, TRUE))
    1191     Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    1192               PCSZ_DOSCREATEMUTEXSEM);
    1193 #endif // 2015-08-04 SHL FIXME to be gone
    1194 #if 0 // 2015-08-07 SHL FIXME to be gone
    1195   rc = DosCreateMutexSem(NULL, &hmtxScanningLocalHD, 0L, FALSE);
    1196   if (rc) {
    1197     Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    1198               PCSZ_DOSCREATEMUTEXSEM);
    1199   }
    1200 #endif // 2015-08-07 SHL FIXME to be gone
    12011178  rc = DosCreateMutexSem(NULL, &hmtxFM2Delete, 0L, FALSE);
    12021179  if (rc) {
     
    12091186              PCSZ_DOSCREATEMUTEXSEM);
    12101187  }
    1211 #if 0 // 2015-08-04 SHL FIXME to be gone
    1212   rc = DosCreateEventSem(NULL, &hevTreeCnrScanComplete, 0L, TRUE);
    1213   if (rc) {
    1214     Dos_Error(MB_CANCEL, rc, HWND_DESKTOP, pszSrcFile, __LINE__,
    1215               PCSZ_DOSCREATEEVENTSEM);
    1216   }
    1217 #endif // 2015-08-04 SHL FIXME to be gone
    12181188
    12191189  /**
  • trunk/dll/init.h

    r1856 r1858  
    4343  02 Aug 15 GKY Serialize local hard drive scanning to reduce drive thrashing continue to scan
    4444                all other drive types in separate threads.
     45  19 Aug 15 SHL Delete obsoletes
    4546
    4647***********************************************************************/
     
    238239extern HMTX hmtxFM2Globals;
    239240extern HMTX hmtxFM2Delete;
    240 
    241 #if 0 // 2015-08-07 SHL FIXME to be gone
    242 extern HMTX hmtxScanning;
    243 #endif // 2015-08-07 SHL FIXME to be gone
    244 
    245 #if 0 // 2015-08-07 SHL FIXME to be gone
    246 extern HMTX hmtxScanningLocalHD;
    247 #endif // 2015-08-07 SHL FIXME to be gone
    248 
    249241extern HMTX hmtxFiltering;
    250242
    251 #if 0 // 2015-08-04 SHL FIXME to be gone
    252 extern HEV  hevTreeCnrScanComplete;
    253 #endif // 2015-08-04 SHL FIXME to be gone
    254 
    255243#endif
    256244
  • trunk/dll/mainwnd.c

    r1856 r1858  
    120120  09 Aug 15 SHL Use RESTORE_STATE_...
    121121  13 Aug 15 SHL Sync with Flesh/Stubby mods
     122  19 Aug 15 SHL Add/use fAmQuitting
     123  19 Aug 15 SHL Delete obsoletes
    122124
    123125***********************************************************************/
     
    214216PFNWP PFNWPButton;
    215217PFNWP PFNWPStatic;
    216 BOOL fAmClosing;
     218BOOL fAmClosing;                        // Attempting to close main window
     219BOOL fAmQuitting;                       // Main window close/destroy in progress
    217220BOOL fAutoTile;
    218221BOOL fAutoView;
     
    18241827MRESULT EXPENTRY DriveBackProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
    18251828{
    1826 #if 0 // 2015-08-04 SHL FIXME to be gone
    1827   APIRET rc;
    1828 #endif // 2015-08-04 SHL FIXME to be gone
    1829 
    18301829  static BOOL emphasized;
    18311830
     
    21012100
    21022101  case WM_COMMAND:
    2103 #if 0 // 2015-08-04 SHL FIXME to be gone
    2104     rc = DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT);
    2105     if (rc)
    2106       Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosWaitEventSem");
    2107 #endif // 2015-08-04 SHL FIXME to be gone
    2108 
    21092102    switch(SHORT1FROMMP(mp1)) {
    21102103    case IDM_RESCAN:
     
    66796672               WM_SYSCOMMAND, MPFROM2SHORT(SC_MINIMIZE, 0), MPVOID);
    66806673    if (CloseChildren(hwnd)) {
     6674      // Close request refused - recover
    66816675      fAmClosing = FALSE;
    66826676      if (fAutoTile)
     
    66886682        WinSendMsg(hwndTree, WM_CLOSE, MPVOID, MPVOID);
    66896683    }
     6684    fAmQuitting = TRUE;                 // Let world know quit in progress
    66906685    DosSleep(1);
    66916686    DbgMsg(pszSrcFile, __LINE__, "MainWndProc WM_CLOSE returning with fAmClosing %u", fAmClosing); // 2015-08-16 SHL
  • trunk/dll/mainwnd.h

    r1856 r1858  
    1515                letter windows; Use button ID to identify drive letter for processing.
    1616  13 Aug 15 SHL Sync with Flesh/Stubby updates
     17  19 Aug 15 SHL Add fAmQuitting
    1718
    1819***********************************************************************/
     
    6566extern RGB2 RGBGREY;
    6667extern BOOL fAmClosing;
     68extern BOOL fAmQuitting;                        // Main window close/destroy in progress
    6769extern BOOL fAutoTile;
    6870extern BOOL fAutoView;
  • trunk/dll/mainwnd2.c

    r1856 r1858  
    14041404    CloseChildren(hwnd);
    14051405    PostMsg(hwnd, UM_CLOSE, MPVOID, MPVOID);
     1406    fAmQuitting = TRUE;                 // Let world know quit in progress
    14061407    DbgMsg(pszSrcFile, __LINE__, "MainWndProc2 WM_CLOSE returning with fAmClosing %u", fAmClosing); // 2015-08-16 SHL
    14071408    DosSleep(1);
  • trunk/dll/treecnr.c

    r1857 r1858  
    326326
    327327    // Try again expanding as needed
    328 
    329     DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec need expand"); // 2015-08-04 SHL FIXME debug
     328    DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec need expand, IsFleshWorkListEmpty %u", IsFleshWorkListEmpty()); // 2015-08-04 SHL FIXME debug
    330329
    331330    cDirLen = strlen(pszDir_);
     
    347346      if (!pciP || (INT)pciP == -1) {
    348347        DbgMsg(pszSrcFile, __LINE__, "ShowTreeRec FindCnrRecord(%s) returned %p", szDir, pciP); // 2015-08-04 SHL FIXME debug
    349         WaitFleshWorkListEmpty();               // 2015-08-13 SHL
     348        WaitFleshWorkListEmpty(szDir);          // 2015-08-19 SHL
    350349        DosSleep(1000);
    351350        break;                                  // No match
     
    364363        WinSendMsg(hwndCnr, CM_EXPANDTREE, MPFROMP(pciP), MPVOID);
    365364        DosSleep(100);                          // 2015-08-13 SHL Let PM catch up
    366         // WaitFleshWorkListEmpty();            // 2015-08-13 SHL
    367       }
    368 
    369       WaitFleshWorkListEmpty();         // 2015-08-13 SHL
     365      }
     366
     367      WaitFleshWorkListEmpty(szDir);    // 2015-08-19 SHL
    370368
    371369      // Add next component to path
     
    433431
    434432      if (!quickbail) {
    435         WaitFleshWorkListEmpty();       // 2015-08-07 SHL FIXME try to ensure contents stable
     433        WaitFleshWorkListEmpty(pszDir_);        // 2015-08-19 SHL try to ensure contents stable
    436434        DbgMsg(pszSrcFile, __LINE__, "WinSendMsg(CM_SETRECORDEMPHASIS, CRA_SELECTED | CRA_CURSORED) \"%s\"", pszDir_); // 2015-08-04 SHL FIXME debug
    437435        WinSendMsg(hwndCnr,
     
    707705  DIRCNRDATA *dcd;
    708706
    709 #if 0 // 2015-08-04 SHL FIXME to be gone
    710   APIRET rc;
    711 #endif // 2015-08-04 SHL FIXME to be gone
    712 
    713707  switch (msg) {
    714708  case UM_SHOWME:
     
    720714      if (dcd) {
    721715
    722 #if 0 // 2015-08-04 SHL FIXME to be gone
    723         rc = DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT);
    724         if (rc)
    725           Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    726 #endif // 2015-08-04 SHL FIXME to be gone
    727 
    728716        /* Hold off if switching on focus change and
    729717           RestoreDirCnrState has restored one or directory directory containers
    730718           See RestoreDirCnrState()
    731719        */
    732         DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME cDirectoriesRestored %u", cDirectoriesRestored, fInitialDriveScan); // 2015-08-04 SHL FIXME debug
     720        DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME cDirectoriesRestored %u", cDirectoriesRestored); // 2015-08-04 SHL FIXME debug
    733721        DbgMsg(pszSrcFile, __LINE__, "TreeObjWndProc UM_SHOWME %s)", mp1); // 2015-08-04 SHL FIXME debug
    734722
     
    940928            pci = FindParentRecord(dcd->hwndCnr, pci);
    941929            driveserial[toupper(*pci->pszFileName) - 'A'] = -1;
    942             WaitFleshWorkListEmpty();   // 2015-08-13 SHL in case pci still in work list
     930            WaitFleshWorkListEmpty(pci->pszFileName);   // 2015-08-19 SHL in case pci still in work list
    943931            AddFleshWorkRequest(dcd->hwndCnr, pci, eUnFlesh);
    944932          }
     
    952940
    953941  case UM_RESCAN:
    954     // populate container
    955 #if 0 // 2015-08-04 SHL FIXME to be gone
    956     rc = DosWaitEventSem(hevTreeCnrScanComplete, SEM_INDEFINITE_WAIT);
    957     if (rc)
    958       Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosWaitEventSem");
    959     rc = DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt);
    960     if (rc)
    961       Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem");
    962 #endif // 2015-08-04 SHL FIXME to be gone
    963 
     942    // Populate container
    964943    dcd = WinQueryWindowPtr(hwnd, QWL_USER);
    965944    if (!dcd)
     
    19311910                    volser.serial)
    19321911                {
    1933                   WaitFleshWorkListEmpty();     // 2015-08-13 SHL in case pci still in work list
     1912                  WaitFleshWorkListEmpty(pci->pszFileName);     // 2015-08-19 SHL in case pci still in work list
    19341913                  AddFleshWorkRequest(hwnd, pci, eUnFlesh);
    19351914                }
     
    19481927              else {
    19491928                driveserial[toupper(*pci->pszFileName) - 'A'] = -1;
    1950                 WaitFleshWorkListEmpty();       // 2015-08-13 SHL in case pci still in work list
     1929                WaitFleshWorkListEmpty(pci->pszFileName);       // 2015-08-19 SHL in case pci still in work list
    19511930                AddFleshWorkRequest(hwnd, pci, eUnFlesh);
    19521931                PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
     
    20262005      INT x;
    20272006
    2028 #if 0 // 2015-08-04 SHL FIXME to be gone
    2029       rc = DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT);
    2030       if (rc)
    2031         Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem");
    2032 #endif // 2015-08-04 SHL FIXME to be gone
    2033 
    2034 #if 0 // 2015-08-04 SHL FIXME to be gone
    2035       rc = DosQueryEventSem(hevTreeCnrScanComplete, &ulScanPostCnt);
    2036       if (rc)
    2037         Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosQueryEventSem");
    2038       if (ulScanPostCnt < 1)
    2039         return 0;
    2040       rc = DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt);
    2041       if (rc)
    2042         Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem");
    2043 #endif // 2015-08-04 SHL FIXME to be gone
    2044 
    20452007      if (fFollowTree)
    20462008        fl = 0;
     
    20572019          if (hwndStatus)
    20582020            WinSetWindowText(hwndStatus, (CHAR *) GetPString(IDS_RESCANSUGTEXT));
    2059 
    2060 #if 0 // 2015-08-04 SHL FIXME to be gone
    2061           rc = DosPostEventSem(hevTreeCnrScanComplete);
    2062           if (rc && rc != ERROR_ALREADY_POSTED)
    2063             Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    2064 #endif // 2015-08-04 SHL FIXME to be gone
    2065 
    20662021          return 0;
    20672022        }
     
    20832038            } // for
    20842039            RemoveCnrItems(hwnd, pciP, 1, CMA_FREE | CMA_INVALIDATE);
    2085 
    2086 #if 0 // 2015-08-04 SHL FIXME to be gone
    2087             rc = DosPostEventSem(hevTreeCnrScanComplete);
    2088             if (rc && rc != ERROR_ALREADY_POSTED)
    2089               Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    2090 #endif // 2015-08-04 SHL FIXME to be gone
    20912040            return 0;
    20922041          }
     
    21312080          if (!rc) {
    21322081            if (!volser.serial || driveserial[x] != volser.serial) {
    2133 #if 1 // 2015-08-04 SHL FIXME to be gone
    21342082              AddFleshWorkRequest(hwnd, pciP, eFlesh);  // forceFlesh
    2135 #else
    2136               Flesh(hwnd, pciP);
    2137 #endif // 2015-08-04 SHL FIXME to be gone
    21382083              driveserial[x] = volser.serial;
    21392084            }
     
    21432088                              MPFROM2SHORT(CMA_FIRSTCHILD, CMA_ITEMORDER));
    21442089            if (!pciL) {
    2145 #if 1 // 2015-08-04 SHL FIXME to be gone
    21462090              AddFleshWorkRequest(hwnd, pciP, eFlesh);  // forceFlesh
    2147 #else
    2148               Flesh(hwnd, pciP);
    2149 #endif // 2015-08-04 SHL FIXME to be gone
    21502091            }
    21512092            if ((fShowFSTypeInTree || fShowDriveLabelInTree) &&
     
    21652106          else {
    21662107            driveserial[x] = -1;
    2167             WaitFleshWorkListEmpty();   // 2015-08-13 SHL in case pci still in work list
     2108            WaitFleshWorkListEmpty(NULL);       // 2015-08-13 SHL in case pci still in work list
    21682109            AddFleshWorkRequest(hwnd, pci, eUnFlesh);
    21692110            PostMsg(hwnd, UM_RESCAN, MPVOID, MPVOID);
    21702111            PostMsg(hwnd, UM_SETUP2, MPFROMP(pci), MPFROMLONG(rc));
    2171 
    2172 #if 0 // 2015-08-04 SHL FIXME to be gone
    2173             rc = DosPostEventSem(hevTreeCnrScanComplete);
    2174             if (rc && rc != ERROR_ALREADY_POSTED)
    2175               Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    2176 #endif // 2015-08-04 SHL FIXME to be gone
    21772112            return 0;
    21782113          }
     
    21972132              PostMsg(hwnd,
    21982133                      WM_COMMAND, MPFROM2SHORT(IDM_SHOWALLFILES, 0), MPVOID);
    2199 
    2200 #if 0 // 2015-08-04 SHL FIXME to be gone
    2201               rc = DosPostEventSem(hevTreeCnrScanComplete);
    2202               if (rc && rc != ERROR_ALREADY_POSTED)
    2203                 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    2204 #endif // 2015-08-04 SHL FIXME to be gone
    22052134              return 0;
    22062135            }
    22072136            if ((shiftstate & (KC_CTRL | KC_SHIFT)) == (KC_CTRL | KC_SHIFT)) {
    22082137              OpenObject(pci->pszFileName, Settings, dcd->hwndFrame);
    2209 
    2210 #if 0 // 2015-08-04 SHL FIXME to be gone
    2211               rc = DosPostEventSem(hevTreeCnrScanComplete);
    2212               if (rc && rc != ERROR_ALREADY_POSTED)
    2213                 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    2214 #endif // 2015-08-04 SHL FIXME to be gone
    22152138              return 0;
    22162139            }
     
    22182141              if (!ParentIsDesktop(hwnd, dcd->hwndParent)) {
    22192142                if (FindDirCnrByName(pci->pszFileName, TRUE)) {
    2220 
    2221 #if 0 // 2015-08-04 SHL FIXME to be gone
    2222                   rc = DosPostEventSem(hevTreeCnrScanComplete);
    2223                   if (rc && rc != ERROR_ALREADY_POSTED)
    2224                     Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    2225 #endif // 2015-08-04 SHL FIXME to be gone
    22262143                  return 0;
    22272144                }
     
    22472164              }
    22482165              OpenObject(pci->pszFileName, s, dcd->hwndFrame);
    2249 
    2250 #if 0 // 2015-08-04 SHL FIXME to be gone
    2251               rc = DosPostEventSem(hevTreeCnrScanComplete);
    2252               if (rc && rc != ERROR_ALREADY_POSTED)
    2253                 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    2254 #endif // 2015-08-04 SHL FIXME to be gone
    22552166              return 0;
    22562167            }
     
    22962207      if (fFollowTree)
    22972208        WinSetFocus(HWND_DESKTOP, hwnd);
    2298 
    2299 #if 0 // 2015-08-04 SHL FIXME to be gone
    2300       rc = DosPostEventSem(hevTreeCnrScanComplete);
    2301       if (rc && rc != ERROR_ALREADY_POSTED)
    2302         Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    2303 #endif // 2015-08-04 SHL FIXME to be gone
    23042209    }
    23052210    return 0;
     
    29922897                break;
    29932898
    2994 #if 0 // 2015-08-04 SHL FIXME to be gone
    2995               rc = DosRequestMutexSem(hmtxScanning, SEM_INDEFINITE_WAIT);
    2996               if (rc)
    2997                 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosRequestMutexSem");
    2998 #endif // 2015-08-04 SHL FIXME to be gone
    2999 
    3000 #if 0 // 2015-08-04 SHL FIXME to be gone
    3001               rc = DosResetEventSem(hevTreeCnrScanComplete, &ulScanPostCnt);
    3002               if (rc)
    3003                 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosResetEventSem");
    3004 #endif // 2015-08-04 SHL FIXME to be gone
    3005 
    3006               // Can't wait here
    3007               // WaitFleshWorkListEmpty();      // 2015-08-13 SHL in case pci still in work list
    30082899              AddFleshWorkRequest(hwnd, pci, eUnFlesh);
     2900
    30092901              // Check if drive type might need update
    30102902              if ((driveflag & (DRIVE_INVALID | DRIVE_NOPRESCAN)) ||
     
    30352927              if (~driveflag & DRIVE_INVALID)
    30362928                AddFleshWorkRequest(hwnd, pci, eFlesh);
    3037 #if 0 // 2015-08-04 SHL FIXME to be gone
    3038               rc = DosPostEventSem(hevTreeCnrScanComplete);
    3039               if (rc && rc != ERROR_ALREADY_POSTED)
    3040                 Dos_Error(MB_ENTER, rc, HWND_DESKTOP, pszSrcFile, __LINE__, "DosPostEventSem");
    3041 #endif // 2015-08-04 SHL FIXME to be gone
    30422929            }
    30432930          }
Note: See TracChangeset for help on using the changeset viewer.