Changeset 754 for trunk/src/emx/src/lib/process/fmutex.c
- Timestamp:
- Sep 30, 2003, 12:11:05 AM (22 years ago)
- File:
-
- 1 edited
-
trunk/src/emx/src/lib/process/fmutex.c (modified) (8 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/emx/src/lib/process/fmutex.c
-
Property cvs2svn:cvs-rev
changed from
1.3to1.4
r753 r754 5 5 #define INCL_DOSPROCESS 6 6 #define INCL_DOSERRORS 7 7 8 #include <os2.h> 8 9 #include <stdlib.h> … … 16 17 unsigned _fmutex_create (_fmutex *sem, unsigned flags) 17 18 { 19 20 18 21 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; 22 28 } 23 29 … … 25 31 unsigned _fmutex_open (_fmutex *sem) 26 32 { 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; 28 39 } 29 40 … … 31 42 unsigned _fmutex_close (_fmutex *sem) 32 43 { 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; 34 50 } 35 51 … … 55 71 for (;;) 56 72 { 73 74 57 75 rc = DosResetEventSem (sem->hev, &count); 76 58 77 if (rc != 0 && rc != ERROR_ALREADY_RESET) 59 78 return rc; … … 62 81 do 63 82 { 83 64 84 rc = DosWaitEventSem (sem->hev, SEM_INDEFINITE_WAIT); 85 65 86 } while (rc == ERROR_INTERRUPT && (flags & _FMR_IGNINT)); 66 87 if (rc != 0) … … 73 94 { 74 95 ULONG rc; 96 75 97 98 76 99 rc = DosPostEventSem (sem->hev); 77 100 if (rc != 0 && rc != ERROR_ALREADY_POSTED) 78 return rc; 101 { 102 FS_RESTORE(); 103 return rc; 104 } 79 105 80 106 /* Give up our time slice to give other threads a chance. Without … … 122 148 123 149 DosSleep (0); 150 124 151 return 0; 125 152 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
