Changeset 1320 for trunk/dll/treecnr.c


Ignore:
Timestamp:
Dec 5, 2008, 3:10:20 PM (17 years ago)
Author:
Gregg Young
Message:

Use event semaphore to prevent rescan of drives while StubbySacnTreads are still running; code cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/treecnr.c

    r1316 r1320  
    802802      Runtime_Error2(pszSrcFile, __LINE__, IDS_NODATATEXT);
    803803    else {
     804      PULONG pulPostCt;
     805
    804806      RemoveCnrItems(dcd->hwndCnr, NULL, 0, CMA_FREE | CMA_INVALIDATE | CMA_ERASE);
    805807      WinSendMsg(dcd->hwndCnr,
     
    808810                 CM_SCROLLWINDOW,
    809811                 MPFROMSHORT(CMA_HORIZONTAL), MPFROMLONG(-1));
    810       while (StubbyScanCount !=0)
    811         DosSleep(50);
     812      if (!fInitialDriveScan) {
     813        DosWaitEventSem(DriveScanStart, 20000);
     814        pulPostCt = xmallocz(sizeof(ULONG), pszSrcFile, __LINE__);
     815        if (pulPostCt) {
     816          DosResetEventSem(DriveScanStart, pulPostCt);
     817          free(pulPostCt);
     818        }
     819      }
     820      else
     821        fInitialDriveScan = FALSE;
    812822      FillTreeCnr(dcd->hwndCnr, dcd->hwndParent);
    813823      if (fOkayMinimize) {
Note: See TracChangeset for help on using the changeset viewer.