Changeset 191


Ignore:
Timestamp:
Jul 24, 2002, 11:49:43 PM (23 years ago)
Author:
umoeller
Message:

Mutex modifications.

Location:
trunk/src/helpers
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/cctl_checkcnr.c

    r184 r191  
    365365    PFNWP               pfnwpOrig = 0;
    366366
    367     if (WinRequestMutexSem(G_hmtxCnrOwnersList, 5000) == NO_ERROR)
     367    if (!DosRequestMutexSem(G_hmtxCnrOwnersList, 5000))
    368368    {
    369369        PLISTNODE   pNode = lstQueryFirstNode(G_pllCnrOwners);
     
    555555
    556556            case WM_DESTROY:
    557                 if (WinRequestMutexSem(G_hmtxCnrOwnersList, 5000) == NO_ERROR)
     557                if (!DosRequestMutexSem(G_hmtxCnrOwnersList, 5000))
    558558                {
    559559                    if (WinIsWindow(pcbco->habCnr,
     
    599599    PFNWP               pfnwpOrig = 0;
    600600
    601     if (WinRequestMutexSem(G_hmtxCnrOwnersList, 5000) == NO_ERROR)
     601    if (!DosRequestMutexSem(G_hmtxCnrOwnersList, 5000))
    602602    {
    603603        PLISTNODE   pNode = lstQueryFirstNode(G_pllCnrOwners);
     
    844844                if (pcbco = ctlSubclassCheckboxContainer(hwndCnr))
    845845                {
    846                     if (WinRequestMutexSem(G_hmtxCnrOwnersList, 5000) == NO_ERROR)
     846                    if (!DosRequestMutexSem(G_hmtxCnrOwnersList, 5000))
    847847                    {
    848848                        lstAppendItem(G_pllCnrOwners, pcbco);
  • trunk/src/helpers/cctl_tooltip.c

    r184 r191  
    152152    }
    153153
    154     return (!WinRequestMutexSem(G_hmtxSubclassedTools, SEM_INDEFINITE_WAIT));
     154    return !DosRequestMutexSem(G_hmtxSubclassedTools, SEM_INDEFINITE_WAIT);
    155155}
    156156
  • trunk/src/helpers/encodings.c

    r187 r191  
    541541
    542542/*
    543  *@@ CreateCaseFold:
     543 *@@ encInitCase:
    544544 *      creates a casefold for later use with
    545545 *      encToUpper.
  • trunk/src/helpers/except.c

    r164 r191  
    117117 *
    118118 *      As a result, you should protect any section of code which
    119  *      requests a semaphore with the exception handlers. To protect
    120  *      yourself against thread termination, use must-complete
    121  *      sections as well (but be careful with those if your code
    122  *      takes a long time to execute... but then you shouldn't
    123  *      request a mutex in the first place).
     119 *      requests a semaphore with the exception handlers.
    124120 *
    125121 *      So _whenever_ you request a mutex semaphore, enclose
     
    133129 +          {
    134130 +              BOOL    fSemOwned = FALSE;
    135  +              ULONG   ulNesting = 0;
    136131 +
    137  +              DosEnterMustComplete(&ulNesting);
    138132 +              TRY_QUIET(excpt1)           // or TRY_LOUD
    139133 +              {
    140  +                  fSemOwned = !WinRequestMutexSem(hmtx, ...);
    141  +                  if (fSemOwned)
     134 +                  if (fSemOwned = !DosRequestMutexSem(hmtx, ...))
    142135 +                  {       ... // work on your protected data
    143136 +                  }
     
    147140 +
    148141 +              if (fSemOwned)
    149  +              {
    150142 +                  // this gets executed always, even if an exception occured
    151143 +                  DosReleaseMutexSem(hmtx);
    152  +                  fSemOwned = FALSE;
    153  +              }
    154  +              DosExitMustComplete(&ulNesting);
    155144 +          } // end of your_func
    156145 *
  • trunk/src/helpers/gpih.c

    r190 r191  
    10431043
    10441044    // subsequent calls: request
    1045     return (!WinRequestMutexSem(G_hmtxLCIDs, SEM_INDEFINITE_WAIT));
     1045    return !DosRequestMutexSem(G_hmtxLCIDs, SEM_INDEFINITE_WAIT);
    10461046}
    10471047
  • trunk/src/helpers/semaphores.c

    r167 r191  
    180180                                  TRUE));      // request!
    181181
    182     return (WinRequestMutexSem(G_hmtxGlobal, SEM_INDEFINITE_WAIT));
     182    return DosRequestMutexSem(G_hmtxGlobal, SEM_INDEFINITE_WAIT);
    183183}
    184184
  • trunk/src/helpers/timer.c

    r169 r191  
    167167                                   TRUE));      // request!
    168168    else
    169         return (!WinRequestMutexSem(G_hmtxTimers, SEM_INDEFINITE_WAIT));
     169        return !DosRequestMutexSem(G_hmtxTimers, SEM_INDEFINITE_WAIT);
    170170}
    171171
Note: See TracChangeset for help on using the changeset viewer.