Ignore:
Timestamp:
Sep 30, 2003, 12:11:05 AM (22 years ago)
Author:
bird
Message:

#679: FS preservation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/lib/process/fmutex.c

    • Property cvs2svn:cvs-rev changed from 1.3 to 1.4
    r753 r754  
    55#define INCL_DOSPROCESS
    66#define INCL_DOSERRORS
     7
    78#include <os2.h>
    89#include <stdlib.h>
     
    1617unsigned _fmutex_create (_fmutex *sem, unsigned flags)
    1718{
     19
     20
    1821  sem->fs = _FMS_AVAILABLE;
    19   return DosCreateEventSem (NULL, (PHEV)&sem->hev,
    20                             (flags & _FMC_SHARED) ? DC_SEM_SHARED : 0,
    21                             FALSE);
     22  FS_SAVE_LOAD();
     23  rc = DosCreateEventSem (NULL, (PHEV)&sem->hev,
     24                          (flags & _FMC_SHARED) ? DC_SEM_SHARED : 0,
     25                           FALSE);
     26  FS_RESTORE();
     27  return rc;
    2228}
    2329
     
    2531unsigned _fmutex_open (_fmutex *sem)
    2632{
    27   return DosOpenEventSem (NULL, (PHEV)&sem->hev);
     33  unsigned rc;
     34  FS_VAR();
     35  FS_SAVE_LOAD();
     36  rc = DosOpenEventSem (NULL, (PHEV)&sem->hev);
     37  FS_RESTORE();
     38  return rc;
    2839}
    2940
     
    3142unsigned _fmutex_close (_fmutex *sem)
    3243{
    33   return DosCloseEventSem (sem->hev);
     44  unsigned rc;
     45  FS_VAR();
     46  FS_SAVE_LOAD();
     47  rc = DosCloseEventSem (sem->hev);
     48  FS_RESTORE();
     49  return rc;
    3450}
    3551
     
    5571  for (;;)
    5672    {
     73
     74
    5775      rc = DosResetEventSem (sem->hev, &count);
     76
    5877      if (rc != 0 && rc != ERROR_ALREADY_RESET)
    5978        return rc;
     
    6281      do
    6382        {
     83
    6484          rc = DosWaitEventSem (sem->hev, SEM_INDEFINITE_WAIT);
     85
    6586        } while (rc == ERROR_INTERRUPT && (flags & _FMR_IGNINT));
    6687      if (rc != 0)
     
    7394{
    7495  ULONG rc;
     96
    7597
     98
    7699  rc = DosPostEventSem (sem->hev);
    77100  if (rc != 0 && rc != ERROR_ALREADY_POSTED)
    78     return rc;
     101    {
     102      FS_RESTORE();
     103      return rc;
     104    }
    79105
    80106  /* Give up our time slice to give other threads a chance.  Without
     
    122148
    123149  DosSleep (0);
     150
    124151  return 0;
    125152}
Note: See TracChangeset for help on using the changeset viewer.