Ignore:
Timestamp:
Dec 27, 2006, 7:56:09 PM (19 years ago)
Author:
bird
Message:

cleanup in progress (evening meal)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libc/src/kNIX/os2/safesems.c

    r2913 r2914  
    22/** @file
    33 *
    4  * kNIX - Internal Signal-Safe Semaphores.
    5  *
    6  * Copyright (c) 2005 knut st. osmundsen <bird@anduin.net>
     4 * kNIX - Internal Signal-Safe Semaphores, OS/2.
     5 *
     6 * Copyright (c) 2005-2006 knut st. osmundsen <bird@anduin.net>
    77 *
    88 *
     
    2525 */
    2626
    27 
    2827/*******************************************************************************
    2928*   Header Files                                                               *
    3029*******************************************************************************/
    31 #define INCL_DOSSEMAPHORES
    32 #define INCL_DOSEXCEPTIONS
    33 #define INCL_DOSERRORS
    34 #define INCL_DOSPROCESS
    35 #define INCL_FSMACROS
    36 #define INCL_EXAPIS
    37 #include <os2emx.h>
    38 #include <sys/errno.h>
    39 #include "syscalls.h"
    40 #include <sys/builtin.h>
    41 #include <klibc/fib.h>
    42 #include <InnoTekLIBC/thread.h>
    43 #include <InnoTekLIBC/backend.h>
     30#include "kNIX.h"
    4431#define __LIBC_LOG_GROUP    __LIBC_LOG_GRP_BACK_IPC
    45 #include <InnoTekLIBC/logstrict.h>
     32#include <klibc/logstrict.h>
    4633
    4734
     
    8067{
    8168    LIBCLOG_ENTER("pmtx=%p fShared=%d\n", (void *)pmtx, fShared);
     69    FS_VAR_SAVE_LOAD();
     70
    8271    pmtx->hmtx = NULLHANDLE;
    8372    pmtx->fShared = fShared;
     
    8574    if (rc)
    8675        rc = -__libc_native2errno(rc);
     76
     77    FS_RESTORE();
    8778    LIBCLOG_RETURN_MSG(rc, "ret %d hmtx=%#lx\n", rc, pmtx->hmtx);
    8879}
     
    9990{
    10091    LIBCLOG_ENTER("pmtx=%p:{.hmtx=%#lx}\n", (void *)pmtx, pmtx->hmtx);
     92    FS_VAR_SAVE_LOAD();
     93
    10194    int rc = DosOpenMutexSemEx(NULL, &pmtx->hmtx);
    10295    if (rc)
    10396        rc = -__libc_native2errno(rc);
     97
     98    FS_RESTORE();
    10499    LIBCLOG_RETURN_INT(rc);
    105100}
     
    116111{
    117112    LIBCLOG_ENTER("pmtx=%p:{.hmtx=%#lx}\n", (void *)pmtx, pmtx->hmtx);
     113    FS_VAR_SAVE_LOAD();
     114
    118115    int rc = DosCloseMutexSemEx(pmtx->hmtx);
    119116    if (rc)
    120117        rc = -__libc_native2errno(rc);
     118
     119    FS_RESTORE();
    121120    LIBCLOG_RETURN_INT(rc);
    122121}
     
    273272{
    274273    LIBCLOG_ENTER("pmtx=%p:{.hmtx=%#lx}\n", (void *)pmtx, pmtx->hmtx);
     274    FS_VAR_SAVE_LOAD();
    275275    ULONG       ul = 0;
    276276    int         rc;
    277     FS_VAR();
    278277
    279278    /*
    280279     * Release the semaphore.
    281280     */
    282     FS_SAVE_LOAD();
    283281    rc = DosReleaseMutexSem(pmtx->hmtx);
    284282    if (__predict_false(rc != NO_ERROR))
     
    306304{
    307305    LIBCLOG_ENTER("phev=%p pmtx=%p:{.hmtx=%#lx} fShared=%d\n", (void *)pev, (void *)pmtx, pmtx->hmtx, fShared);
     306    FS_VAR_SAVE_LOAD();
    308307
    309308    pev->hev        = NULLHANDLE;
     
    316315        rc = -__libc_native2errno(rc);
    317316
     317    FS_RESTORE();
    318318    LIBCLOG_RETURN_MSG(rc, "ret %d pev->hev=%#lx\n", rc, pev->hev);
    319319}
     
    334334    LIBCLOG_ENTER("pev=%p:{.hev=%#lx .cWaiters=%d .pmtx=%p .fShared=%d}\n",
    335335                  (void *)pev, pev->hev, pev->cWaiters, (void *)pev->pmtx, pev->fShared);
     336    FS_VAR_SAVE_LOAD();
    336337
    337338    int rc = DosOpenEventSemEx(NULL, &pev->hev);
     
    339340        rc = -__libc_native2errno(rc);
    340341
     342    FS_RESTORE();
    341343    LIBCLOG_RETURN_INT(rc);
    342344}
     
    354356    LIBCLOG_ENTER("pev=%p:{.hev=%#lx .cWaiters=%d .pmtx=%p .fShared=%d}\n",
    355357                  (void *)pev, pev->hev, pev->cWaiters, (void *)pev->pmtx, pev->fShared);
     358    FS_VAR_SAVE_LOAD();
    356359
    357360    int rc = DosCloseEventSemEx(pev->hev);
     
    359362        rc = -__libc_native2errno(rc);
    360363
     364    FS_RESTORE();
    361365    LIBCLOG_RETURN_INT(rc);
    362366}
Note: See TracChangeset for help on using the changeset viewer.