Changeset 78


Ignore:
Timestamp:
May 28, 2001, 9:47:12 AM (24 years ago)
Author:
umoeller
Message:

Misc changes.

Location:
trunk/src/helpers
Files:
2 edited

Legend:

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

    r77 r78  
    102102 *
    103103 *@@added V0.9.4 (2000-08-02) [umoeller]
     104 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from dosh2.c to apps.c
    104105 */
    105106
     
    156157 *
    157158 *@@added V0.9.4 (2000-07-19) [umoeller]
     159 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from dosh2.c to apps.c
    158160 */
    159161
     
    196198 *@@added V0.9.4 (2000-07-19) [umoeller]
    197199 *@@changed V0.9.12 (2001-05-21) [umoeller]: fixed memory leak
     200 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from dosh2.c to apps.c
    198201 */
    199202
    200203PSZ* appFindEnvironmentVar(PDOSENVIRONMENT pEnv,
    201                             PSZ pszVarName)
     204                           PSZ pszVarName)
    202205{
    203206    PSZ *ppszRet = 0;
     
    272275 *@@changed V0.9.12 (2001-05-21) [umoeller]: fixed memory leak
    273276 *@@changed V0.9.12 (2001-05-26) [umoeller]: fixed crash if !fAddFirst
     277 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from dosh2.c to apps.c
    274278 */
    275279
     
    363367 *
    364368 *@@added V0.9.4 (2000-07-19) [umoeller]
     369 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from dosh2.c to apps.c
    365370 */
    366371
     
    434439 *
    435440 *@@added V0.9.4 (2000-07-19) [umoeller]
     441 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from dosh2.c to apps.c
    436442 */
    437443
     
    486492 *@@added V0.9.6 (2000-10-16) [umoeller]
    487493 *@@changed V0.9.7 (2001-01-15) [umoeller]: now using XSTRING
     494 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from winh.c to apps.c
    488495 */
    489496
     
    564571 *
    565572 *@@added V0.9.9 (2001-03-07) [umoeller]
     573 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from winh.c to apps.c
    566574 */
    567575
     
    735743 *      --  If PROGDETAILS specifies a Win-OS/2 session
    736744 *          and PROGDETAILS.pszEnvironment is empty,
    737  *          this merges the current process environment
    738  *          with the default Win-OS/2 environment.
     745 *          this uses the default Win-OS/2 environment.
    739746 *          See appQueryDefaultWin31Environment.
    740747 *
     
    756763 *@@changed V0.9.9 (2001-01-27) [umoeller]: crashed if PROGDETAILS.pszExecutable was NULL
    757764 *@@changed V0.9.12 (2001-05-26) [umoeller]: fixed PROG_DEFAULT
     765 *@@changed V0.9.12 (2001-05-27) [umoeller]: moved from winh.c to apps.c
    758766 */
    759767
     
    918926            PSZ pszTemp = appQueryDefaultWin31Environment();
    919927
    920             /* if (!appParseEnvironment(pszTemp,
    921                                      &Env)) */
     928            if (!appParseEnvironment(pszTemp,
     929                                     &Env))
    922930            {
    923931                // now override KBD_CTRL_BYPASS=CTRL_ESC
  • trunk/src/helpers/semaphores.c

    r77 r78  
    169169 *      I have created, this returns an APIRET.
    170170 *
    171  *@@added V0.9.12 (2001-05-27) [umoeller]
    172171 */
    173172
     
    187186 *@@ UnlockGlobal:
    188187 *
    189  *@@added V0.9.12 (2001-05-27) [umoeller]
    190188 */
    191189
     
    258256 *          was set to NULLHANDLE.
    259257 *
    260  *      --  ERROR_SEM_BUSY: couldn't delete one
    261  *          of the member semaphores because they
    262  *          were held by some other thread.
    263  */
    264 
    265 APIRET semDeleteRWMutex(PHRW phrw)
     258 *      --  ERROR_SEM_BUSY: semaphore is currently
     259 *          requested.
     260 */
     261
     262APIRET semDeleteRWMutex(PHRW phrw)      // in/out: rwsem handle
    266263{
    267264    APIRET  arc = NO_ERROR;
     
    274271           )
    275272        {
    276             if (    (!(arc = DosCloseEventSem(pMutex->hevWriterDone)))
    277                  && (!(arc = DosCloseEventSem(pMutex->hevReadersDone)))
     273            if (    (pMutex->cReaders)
     274                 || (pMutex->cWriters)
    278275               )
     276                arc = ERROR_SEM_BUSY;
     277            else
    279278            {
    280                 ULONG cItems = pMutex->cReaderThreads;
    281                 TREE **papNodes = treeBuildArray(pMutex->ReaderThreadsTree,
    282                                                  &cItems);
    283                 if (papNodes)
     279                if (    (!(arc = DosCloseEventSem(pMutex->hevWriterDone)))
     280                     && (!(arc = DosCloseEventSem(pMutex->hevReadersDone)))
     281                   )
    284282                {
    285                     ULONG ul;
    286                     for (ul = 0; ul < cItems; ul++)
    287                         free(papNodes[ul]);
    288 
    289                     free(papNodes);
     283                    ULONG cItems = pMutex->cReaderThreads;
     284                    TREE **papNodes = treeBuildArray(pMutex->ReaderThreadsTree,
     285                                                     &cItems);
     286                    if (papNodes)
     287                    {
     288                        ULONG ul;
     289                        for (ul = 0; ul < cItems; ul++)
     290                            free(papNodes[ul]);
     291
     292                        free(papNodes);
     293                    }
     294
     295                    free(pMutex);
     296                    *phrw = NULLHANDLE;
    290297                }
    291 
    292                 free(pMutex);
    293                 *phrw = NULLHANDLE;
    294298            }
    295299        }
Note: See TracChangeset for help on using the changeset viewer.