Changeset 2914 for trunk/libc/src/kNIX/os2/safesems.c
- Timestamp:
- Dec 27, 2006, 7:56:09 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/src/kNIX/os2/safesems.c
r2913 r2914 2 2 /** @file 3 3 * 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> 7 7 * 8 8 * … … 25 25 */ 26 26 27 28 27 /******************************************************************************* 29 28 * Header Files * 30 29 *******************************************************************************/ 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" 44 31 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_BACK_IPC 45 #include < InnoTekLIBC/logstrict.h>32 #include <klibc/logstrict.h> 46 33 47 34 … … 80 67 { 81 68 LIBCLOG_ENTER("pmtx=%p fShared=%d\n", (void *)pmtx, fShared); 69 FS_VAR_SAVE_LOAD(); 70 82 71 pmtx->hmtx = NULLHANDLE; 83 72 pmtx->fShared = fShared; … … 85 74 if (rc) 86 75 rc = -__libc_native2errno(rc); 76 77 FS_RESTORE(); 87 78 LIBCLOG_RETURN_MSG(rc, "ret %d hmtx=%#lx\n", rc, pmtx->hmtx); 88 79 } … … 99 90 { 100 91 LIBCLOG_ENTER("pmtx=%p:{.hmtx=%#lx}\n", (void *)pmtx, pmtx->hmtx); 92 FS_VAR_SAVE_LOAD(); 93 101 94 int rc = DosOpenMutexSemEx(NULL, &pmtx->hmtx); 102 95 if (rc) 103 96 rc = -__libc_native2errno(rc); 97 98 FS_RESTORE(); 104 99 LIBCLOG_RETURN_INT(rc); 105 100 } … … 116 111 { 117 112 LIBCLOG_ENTER("pmtx=%p:{.hmtx=%#lx}\n", (void *)pmtx, pmtx->hmtx); 113 FS_VAR_SAVE_LOAD(); 114 118 115 int rc = DosCloseMutexSemEx(pmtx->hmtx); 119 116 if (rc) 120 117 rc = -__libc_native2errno(rc); 118 119 FS_RESTORE(); 121 120 LIBCLOG_RETURN_INT(rc); 122 121 } … … 273 272 { 274 273 LIBCLOG_ENTER("pmtx=%p:{.hmtx=%#lx}\n", (void *)pmtx, pmtx->hmtx); 274 FS_VAR_SAVE_LOAD(); 275 275 ULONG ul = 0; 276 276 int rc; 277 FS_VAR();278 277 279 278 /* 280 279 * Release the semaphore. 281 280 */ 282 FS_SAVE_LOAD();283 281 rc = DosReleaseMutexSem(pmtx->hmtx); 284 282 if (__predict_false(rc != NO_ERROR)) … … 306 304 { 307 305 LIBCLOG_ENTER("phev=%p pmtx=%p:{.hmtx=%#lx} fShared=%d\n", (void *)pev, (void *)pmtx, pmtx->hmtx, fShared); 306 FS_VAR_SAVE_LOAD(); 308 307 309 308 pev->hev = NULLHANDLE; … … 316 315 rc = -__libc_native2errno(rc); 317 316 317 FS_RESTORE(); 318 318 LIBCLOG_RETURN_MSG(rc, "ret %d pev->hev=%#lx\n", rc, pev->hev); 319 319 } … … 334 334 LIBCLOG_ENTER("pev=%p:{.hev=%#lx .cWaiters=%d .pmtx=%p .fShared=%d}\n", 335 335 (void *)pev, pev->hev, pev->cWaiters, (void *)pev->pmtx, pev->fShared); 336 FS_VAR_SAVE_LOAD(); 336 337 337 338 int rc = DosOpenEventSemEx(NULL, &pev->hev); … … 339 340 rc = -__libc_native2errno(rc); 340 341 342 FS_RESTORE(); 341 343 LIBCLOG_RETURN_INT(rc); 342 344 } … … 354 356 LIBCLOG_ENTER("pev=%p:{.hev=%#lx .cWaiters=%d .pmtx=%p .fShared=%d}\n", 355 357 (void *)pev, pev->hev, pev->cWaiters, (void *)pev->pmtx, pev->fShared); 358 FS_VAR_SAVE_LOAD(); 356 359 357 360 int rc = DosCloseEventSemEx(pev->hev); … … 359 362 rc = -__libc_native2errno(rc); 360 363 364 FS_RESTORE(); 361 365 LIBCLOG_RETURN_INT(rc); 362 366 }
Note:
See TracChangeset
for help on using the changeset viewer.