Changeset 25717 in vbox for trunk/src/VBox/Runtime/r3/os2/sems-os2.cpp
- Timestamp:
- Jan 11, 2010 1:24:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/os2/sems-os2.cpp
r25711 r25717 47 47 48 48 49 /* Undefine debug mappings. */ 50 #undef RTSemMutexRequest 51 #undef RTSemMutexRequestNoResume 52 53 54 RTDECL(int) RTSemEventCreate(PRTSEMEVENT pEventSem) 55 { 49 50 RTDECL(int) RTSemEventCreate(PRTSEMEVENT phEventSem) 51 { 52 return RTSemEventCreateEx(phEventSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL); 53 } 54 55 56 RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem, uint32_t fFlags, RTLOCKVALCLASS hClass, const char *pszNameFmt, ...) 57 { 58 AssertReturn(!(fFlags & ~RTSEMEVENT_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER); 59 56 60 /* 57 61 * Create the semaphore. … … 62 66 if (!rc) 63 67 { 64 *p EventSem = (RTSEMEVENT)(void *)hev;65 return VINF_SUCCESS; 66 } 67 return RTErrConvertFromOS2(rc); 68 } 69 70 71 RTDECL(int) RTSemEventDestroy(RTSEMEVENT EventSem)72 { 73 if ( EventSem == NIL_RTSEMEVENT) /* don't bitch */74 return V ERR_INVALID_HANDLE;68 *phEventSem = (RTSEMEVENT)(void *)hev; 69 return VINF_SUCCESS; 70 } 71 return RTErrConvertFromOS2(rc); 72 } 73 74 75 RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) 76 { 77 if (hEventSem == NIL_RTSEMEVENT) 78 return VINF_SUCCESS; 75 79 76 80 /* 77 81 * Close semaphore handle. 78 82 */ 79 int rc = DosCloseEventSem(SEM2HND( EventSem));80 if (!rc) 81 return VINF_SUCCESS; 82 AssertMsgFailed(("Destroy EventSem %p failed, rc=%d\n",EventSem, rc));83 return RTErrConvertFromOS2(rc); 84 } 85 86 87 RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT EventSem, unsigned cMillies)83 int rc = DosCloseEventSem(SEM2HND(hEventSem)); 84 if (!rc) 85 return VINF_SUCCESS; 86 AssertMsgFailed(("Destroy hEventSem %p failed, rc=%d\n", hEventSem, rc)); 87 return RTErrConvertFromOS2(rc); 88 } 89 90 91 RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies) 88 92 { 89 93 /* 90 94 * Wait for condition. 91 95 */ 92 int rc = DosWaitEventSem(SEM2HND( EventSem), cMillies == RT_INDEFINITE_WAIT ? SEM_INDEFINITE_WAIT : cMillies);96 int rc = DosWaitEventSem(SEM2HND(hEventSem), cMillies == RT_INDEFINITE_WAIT ? SEM_INDEFINITE_WAIT : cMillies); 93 97 switch (rc) 94 98 { … … 99 103 default: 100 104 { 101 AssertMsgFailed(("Wait on EventSem %p failed, rc=%d\n",EventSem, rc));105 AssertMsgFailed(("Wait on hEventSem %p failed, rc=%d\n", hEventSem, rc)); 102 106 return RTErrConvertFromOS2(rc); 103 107 } … … 106 110 107 111 108 RTDECL(int) RTSemEventSignal(RTSEMEVENT EventSem)112 RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) 109 113 { 110 114 /* 111 115 * Signal the object. 112 116 */ 113 int rc = DosPostEventSem(SEM2HND( EventSem));117 int rc = DosPostEventSem(SEM2HND(hEventSem)); 114 118 switch (rc) 115 119 { … … 292 296 293 297 298 #undef RTSemMutexRequestNoResume 294 299 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies) 295 300 {
Note:
See TracChangeset
for help on using the changeset viewer.