Changeset 25711 in vbox for trunk/src/VBox/Runtime/r3/posix
- Timestamp:
- Jan 11, 2010 11:15:04 AM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56449
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/r3/posix/semmutex-posix.cpp
r25704 r25711 71 71 72 72 73 /* Undefine debug mappings. */ 74 #undef RTSemMutexRequest 75 #undef RTSemMutexRequestNoResume 76 77 78 RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX pMutexSem) 79 { 73 #undef RTSemMutexCreate 74 RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX phMutexSem) 75 { 76 return RTSemMutexCreateEx(phMutexSem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, NULL); 77 } 78 79 80 RTDECL(int) RTSemMutexCreateEx(PRTSEMMUTEX phMutexSem, uint32_t fFlags, 81 RTLOCKVALCLASS hClass, uint32_t uSubClass, const char *pszNameFmt, ...) 82 { 83 AssertReturn(!(fFlags & ~RTSEMMUTEX_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER); 84 85 /* 86 * Allocate semaphore handle. 87 */ 80 88 int rc; 81 82 /*83 * Allocate semaphore handle.84 */85 89 struct RTSEMMUTEXINTERNAL *pThis = (struct RTSEMMUTEXINTERNAL *)RTMemAlloc(sizeof(struct RTSEMMUTEXINTERNAL)); 86 90 if (pThis) … … 102 106 pThis->u32Magic = RTSEMMUTEX_MAGIC; 103 107 #ifdef RTSEMMUTEX_STRICT 104 RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis, 105 true /*fEnabled*/, "RTSemMutex"); 106 #endif 107 108 *pMutexSem = pThis; 108 va_list va; 109 va_start(va, pszNameFmt); 110 RTLockValidatorRecExclInitV(&pThis->ValidatorRec, hClass, uSubClass, pThis, 111 !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL), pszNameFmt, va); 112 va_end(va); 113 #endif 114 115 *phMutexSem = pThis; 109 116 return VINF_SUCCESS; 110 117 } … … 153 160 154 161 return VINF_SUCCESS; 162 } 163 164 165 RTDECL(uint32_t) RTSemMutexSetSubClass(RTSEMMUTEX hMutexSem, uint32_t uSubClass) 166 { 167 #ifdef RTSEMMUTEX_STRICT 168 /* 169 * Validate. 170 */ 171 RTSEMMUTEXINTERNAL *pThis = hMutexSem; 172 AssertPtrReturn(pThis, RTLOCKVAL_SUB_CLASS_INVALID); 173 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, RTLOCKVAL_SUB_CLASS_INVALID); 174 175 return RTLockValidatorRecExclSetSubClass(&pThis->ValidatorRec, uSubClass); 176 #else 177 return RTLOCKVAL_SUB_CLASS_INVALID; 178 #endif 155 179 } 156 180 … … 256 280 257 281 282 #undef RTSemMutexRequest 258 283 RTDECL(int) RTSemMutexRequest(RTSEMMUTEX MutexSem, unsigned cMillies) 259 284 { … … 274 299 275 300 301 #undef RTSemMutexRequestNoResume 276 302 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies) 277 303 {
Note:
See TracChangeset
for help on using the changeset viewer.