Changeset 25717 in vbox for trunk/src/VBox/Runtime/r3/linux
- Timestamp:
- Jan 11, 2010 1:24:09 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56457
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/linux/semevent-linux.cpp
r25704 r25717 117 117 118 118 119 RTDECL(int) RTSemEventCreate(PRTSEMEVENT pEventSem) 120 { 119 RTDECL(int) RTSemEventCreate(PRTSEMEVENT phEventSem) 120 { 121 return RTSemEventCreateEx(phEventSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, NULL); 122 } 123 124 125 RTDECL(int) RTSemEventCreateEx(PRTSEMEVENT phEventSem, uint32_t fFlags, RTLOCKVALCLASS hClass, const char *pszNameFmt, ...) 126 { 127 AssertReturn(!(fFlags & ~RTSEMEVENT_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER); 128 121 129 /* 122 130 * Allocate semaphore handle. … … 129 137 pThis->fSignalled = 0; 130 138 #ifdef RTSEMEVENT_STRICT 131 RTLockValidatorRecSharedInit(&pThis->Signallers, 132 NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY, 133 pThis, true /*fSignaller*/, true /*fEnabled*/, "RTSemEvent"); 139 va_list va; 140 va_start(va, pszNameFmt); 141 RTLockValidatorRecSharedInitV(&pThis->Signallers, hClass, RTLOCKVAL_SUB_CLASS_ANY, pThis, 142 true /*fSignaller*/, !(fFlags & RTSEMEVENT_FLAGS_NO_LOCK_VAL), 143 pszNameFmt, va); 144 va_end(va); 134 145 pThis->fEverHadSignallers = false; 135 146 #endif 136 *pEventSem = pThis; 147 148 *phEventSem = pThis; 137 149 return VINF_SUCCESS; 138 150 } … … 141 153 142 154 143 RTDECL(int) RTSemEventDestroy(RTSEMEVENT EventSem)155 RTDECL(int) RTSemEventDestroy(RTSEMEVENT hEventSem) 144 156 { 145 157 /* 146 158 * Validate input. 147 159 */ 148 if (EventSem == NIL_RTSEMEVENT) /* don't bitch */149 return VERR_INVALID_HANDLE;150 struct RTSEMEVENTINTERNAL *pThis = EventSem;160 struct RTSEMEVENTINTERNAL *pThis = hEventSem; 161 if (pThis == NIL_RTSEMEVENT) 162 return VINF_SUCCESS; 151 163 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 152 164 AssertReturn(pThis->iMagic == RTSEMEVENT_MAGIC, VERR_INVALID_HANDLE); … … 173 185 174 186 175 RTDECL(int) RTSemEventSignal(RTSEMEVENT EventSem)187 RTDECL(int) RTSemEventSignal(RTSEMEVENT hEventSem) 176 188 { 177 189 /* 178 190 * Validate input. 179 191 */ 180 struct RTSEMEVENTINTERNAL *pThis = EventSem;192 struct RTSEMEVENTINTERNAL *pThis = hEventSem; 181 193 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 182 194 AssertReturn(pThis->iMagic == RTSEMEVENT_MAGIC, VERR_INVALID_HANDLE); … … 207 219 208 220 209 static int rtSemEventWait(RTSEMEVENT EventSem, unsigned cMillies, bool fAutoResume)221 static int rtSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies, bool fAutoResume) 210 222 { 211 223 PCRTLOCKVALSRCPOS pSrcPos = NULL; … … 214 226 * Validate input. 215 227 */ 216 struct RTSEMEVENTINTERNAL *pThis = EventSem;228 struct RTSEMEVENTINTERNAL *pThis = hEventSem; 217 229 AssertPtrReturn(pThis, VERR_INVALID_HANDLE); 218 230 AssertReturn(pThis->iMagic == RTSEMEVENT_MAGIC, VERR_INVALID_HANDLE); … … 319 331 320 332 321 RTDECL(int) RTSemEventWait(RTSEMEVENT EventSem, unsigned cMillies)322 { 323 int rc = rtSemEventWait( EventSem, cMillies, true);333 RTDECL(int) RTSemEventWait(RTSEMEVENT hEventSem, unsigned cMillies) 334 { 335 int rc = rtSemEventWait(hEventSem, cMillies, true); 324 336 Assert(rc != VERR_INTERRUPTED); 325 337 Assert(rc != VERR_TIMEOUT || cMillies != RT_INDEFINITE_WAIT); … … 328 340 329 341 330 RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT EventSem, unsigned cMillies)331 { 332 return rtSemEventWait( EventSem, cMillies, false);342 RTDECL(int) RTSemEventWaitNoResume(RTSEMEVENT hEventSem, unsigned cMillies) 343 { 344 return rtSemEventWait(hEventSem, cMillies, false); 333 345 } 334 346
Note:
See TracChangeset
for help on using the changeset viewer.