Changeset 1303


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.

Location:
trunk/dll
Files:
6 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) {
  • trunk/dll/grep.c

    r1223 r1303  
    2929  07 Feb 08 SHL Use ITIMER_DESC to control sleeps and reporting
    3030  29 Feb 08 GKY Use xfree where appropriate
     31  29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate.
    3132
    3233***********************************************************************/
     
    6263#include "misc.h"                       // PostMsg
    6364#include "fortify.h"
     65#include "init.h"                       // Golbal semaphore
    6466
    6567static VOID DoAllSubdirs(GREP *grep,
     
    743745               CM_INSERTRECORD, MPFROMP(pciFirst), MPFROMP(&ri));
    744746    if (dcd) {
    745       DosEnterCritSec();
     747      //DosEnterCritSec(); //GKY 11-29-08
     748      DosRequestMutexSem(hmtxFM2Globals, SEM_INDEFINITE_WAIT);
    746749      dcd->ullTotalBytes += grep->insertedbytes;
    747       DosExitCritSec();
     750      DosReleaseMutexSem(hmtxFM2Globals);
     751      //DosExitCritSec();
    748752    }
    749753    SleepIfNeeded(pitdSleep, 1);
  • trunk/dll/init.c

    r1224 r1303  
    5757  23 Aug 08 GKY Check that space on TMP & FM2 save drives exceed 5 GiB; Done to allow user setting of
    5858                minimum size in future
     59  29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate.
    5960
    6061***********************************************************************/
     
    155156
    156157#pragma data_seg(GLOBAL1)
     158HMTX hmtxFM2Globals;
    157159ULONG OS2ver[2];
    158160PFNWP PFNWPCnr;
     
    11771179                   sizeof(PVOID));
    11781180
     1181  DosCreateMutexSem("\\SEM\\GLOBAL1", &hmtxFM2Globals, 0L, FALSE);
     1182
    11791183  /*
    11801184   * set some defaults (note: everything else automatically initialized
  • trunk/dll/init.h

    r1209 r1303  
    1010
    1111  Change log
     12  29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate.
    1213
    1314***********************************************************************/
     
    9091extern CHAR profile[CCHMAXPATH];
    9192extern ULONGLONG ullTmpSpaceNeeded;
     93extern HMTX hmtxFM2Globals;
    9294
    9395#endif // INIT_H
  • trunk/dll/mainwnd.c

    r1224 r1303  
    6969  29 Aug 08 JBS Ticket 259: Support saving/restoring target directories with states (except the shutdown state)
    7070  01 Sep 08 GKY Save toolbars immediately on change. Add bmps for default toolbars
     71  29 Nov 08 GKY Remove or replace with a mutex semaphore DosEnterCriSec where appropriate.
    7172
    7273***********************************************************************/
     
    14011402
    14021403  case WM_CONTEXTMENU:
    1403     DosEnterCritSec();
     1404    //DosEnterCritSec(); //GKY 11-29-08
     1405    DosRequestMutexSem(hmtxFM2Globals, SEM_INDEFINITE_WAIT);
    14041406    if (!hwndMenu)
    14051407      hwndMenu = WinLoadMenu(hwnd, FM3ModHandle, ID_BUTTONMENU);
    1406     DosExitCritSec();
     1408    DosReleaseMutexSem(hmtxFM2Globals);
     1409    //DosExitCritSec();
    14071410    SetPresParams(hwndMenu, NULL, NULL, NULL, GetPString(IDS_10SYSPROTEXT));
    14081411    if (PopupMenu(hwnd, hwnd, hwndMenu))
  • trunk/dll/treecnr.c

    r1299 r1303  
    4949  19 Oct 08 GKY Fixed logic for greying menu items (Format etc) on remote and virtual drives (it was reversed)
    5050  19 Oct 08 GKY Fixed context menu to be "drives" menu on unformatted drives
     51  28 Nov 08 GKY Remove unneeded DosEnterCriSec calls
    5152
    5253***********************************************************************/
Note: See TracChangeset for help on using the changeset viewer.