Changeset 1303 for trunk/dll/dircnrs.c


Ignore:
Timestamp:
Nov 30, 2008, 6:31:35 AM (17 years ago)
Author:
Gregg Young
Message:

Last part of remove or replace with a mutex semaphore DosEnterCriSec where appropriate. (Ticket 308) Note the partial commits for this ticket won't build without this.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/dircnrs.c

    r1222 r1303  
    4949  25 Aug 08 GKY Check TMP directory space warn if lee than 5 MiB prevent archiver from opening if
    5050                less than 10 KiB (It hangs and can't be closed)
     51  29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate.
    5152
    5253***********************************************************************/
     
    798799    dcd = WinQueryWindowPtr(hwnd, QWL_USER);
    799800    if (dcd) {
    800       DosEnterCritSec();
     801      //DosEnterCritSec(); //GKY 11-29-08
     802      DosRequestMutexSem(hmtxFM2Globals, SEM_INDEFINITE_WAIT);
    801803      if (dcd->stopflag)
    802804        dcd->stopflag--;
    803805      if (dcd->stopflag) {
    804         DosExitCritSec();
     806        DosReleaseMutexSem(hmtxFM2Globals);
     807        //DosExitCritSec();
    805808        return 0;
    806809      }
    807       DosExitCritSec();
     810      DosReleaseMutexSem(hmtxFM2Globals);
     811      //DosExitCritSec();
    808812      if (mp1) {
    809813        strcpy(dcd->previous, dcd->directory);
     
    14191423          strcpy(dcd->previous, dcd->directory);
    14201424          strcpy(dcd->directory, fullname);
    1421           DosEnterCritSec();
     1425          //DosEnterCritSec(); //GKY 11-27-08
    14221426          dcd->stopflag++;
    1423           DosExitCritSec();
     1427          //DosExitCritSec();
    14241428          if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    14251429            strcpy(dcd->directory, dcd->previous);
    1426             DosEnterCritSec();
     1430            //DosEnterCritSec(); //GKY 11-27-08
    14271431            dcd->stopflag--;
    1428             DosExitCritSec();
     1432            //DosExitCritSec();
    14291433          }
    14301434          else if (*dcd->directory) {
     
    22862290
    22872291      case IDM_RESCAN:
    2288         DosEnterCritSec();
     2292        //DosEnterCritSec(); //GKY 11-27-08
    22892293        dcd->stopflag++;
    2290         DosExitCritSec();
     2294        //DosExitCritSec();
    22912295        if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPVOID)) {
    2292           DosEnterCritSec();
     2296          //DosEnterCritSec(); //GKY 11-27-08
    22932297          dcd->stopflag--;
    2294           DosExitCritSec();
     2298          //DosExitCritSec();
    22952299        }
    22962300        break;
     
    24242428          strcpy(dcd->previous, dcd->directory);
    24252429          strcpy(dcd->directory, (CHAR *)mp2);
    2426           DosEnterCritSec();
     2430          //DosEnterCritSec(); // GKY 11-27-08
    24272431          dcd->stopflag++;
    2428           DosExitCritSec();
     2432          //DosExitCritSec();
    24292433          if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    24302434            strcpy(dcd->directory, dcd->previous);
    2431             DosEnterCritSec();
     2435            //DosEnterCritSec(); // GKY 11-27-08
    24322436            dcd->stopflag--;
    2433             DosExitCritSec();
     2437            //DosExitCritSec();
    24342438          }
    24352439          else if (*dcd->directory) {
     
    24582462              strcpy(dcd->previous, dcd->directory);
    24592463              strcpy(dcd->directory, tempname2);
    2460               DosEnterCritSec();
     2464              //DosEnterCritSec(); // GKY 11-27-08
    24612465              dcd->stopflag++;
    2462               DosExitCritSec();
     2466              //DosExitCritSec();
    24632467              if (!PostMsg(dcd->hwndObject,
    24642468                           UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    24652469                strcpy(dcd->directory, dcd->previous);
    2466                 DosEnterCritSec();
     2470                //DosEnterCritSec();// GKY 11-27-08
    24672471                dcd->stopflag--;
    2468                 DosExitCritSec();
     2472                //DosExitCritSec();
    24692473              }
    24702474              else if (*dcd->directory) {
     
    24902494            strcpy(dcd->directory, dcd->previous);
    24912495            strcpy(dcd->previous, tempname);
    2492             DosEnterCritSec();
     2496            //DosEnterCritSec(); // GKY 11-27-08
    24932497            dcd->stopflag++;
    2494             DosExitCritSec();
     2498            //DosExitCritSec();
    24952499            if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    24962500              strcpy(dcd->directory, dcd->previous);
    2497               DosEnterCritSec();
     2501              //DosEnterCritSec(); // GKY 11-27-08
    24982502              dcd->stopflag--;
    2499               DosExitCritSec();
     2503              //DosExitCritSec();
    25002504            }
    25012505            else if (*dcd->directory) {
     
    25272531            strcpy(dcd->previous, dcd->directory);
    25282532            strcpy(dcd->directory, newdir);
    2529             DosEnterCritSec();
     2533            //DosEnterCritSec(); //GKY 11-27-08
    25302534            dcd->stopflag++;
    2531             DosExitCritSec();
     2535            //DosExitCritSec();
    25322536            if (!PostMsg(dcd->hwndObject, UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    25332537              strcpy(dcd->directory, dcd->previous);
    2534               DosEnterCritSec();
     2538              //DosEnterCritSec(); // GKY 11-27-08
    25352539              dcd->stopflag--;
    2536               DosExitCritSec();
     2540              //DosExitCritSec();
    25372541            }
    25382542            else if (*dcd->directory) {
     
    33633367                  strcpy(dcd->previous, dcd->directory);
    33643368                  strcpy(dcd->directory, pci->pszFileName);
    3365                   DosEnterCritSec();
     3369                  //DosEnterCritSec();  // GKY 11-27-08
    33663370                  dcd->stopflag++;
    3367                   DosExitCritSec();
     3371                  //DosExitCritSec();
    33683372                  if (!PostMsg(dcd->hwndObject,
    33693373                               UM_RESCAN, MPVOID, MPFROMLONG(1))) {
    3370                     DosEnterCritSec();
     3374                    //DosEnterCritSec();  // GKY 11-27-08
    33713375                    dcd->stopflag--;
    3372                     DosExitCritSec();
     3376                    //DosExitCritSec();
    33733377                  }
    33743378                  else if (*dcd->directory) {
     
    34103414              }
    34113415              else {
    3412                 DosEnterCritSec();
     3416                //DosEnterCritSec();  // GKY 11-27-08
    34133417                dcd->stopflag++;
    3414                 DosExitCritSec();
     3418                //DosExitCritSec();
    34153419                if (!PostMsg(dcd->hwndObject,
    34163420                             UM_RESCAN, MPVOID, MPFROMLONG(1L))) {
    3417                   DosEnterCritSec();
     3421                  //DosEnterCritSec(); // GKY 11-27-08
    34183422                  dcd->stopflag--;
    3419                   DosExitCritSec();
     3423                  //DosExitCritSec();
    34203424                }
    34213425                else if (*dcd->directory) {
Note: See TracChangeset for help on using the changeset viewer.