Changeset 25711 in vbox for trunk/src/VBox/Runtime/r3/win
- 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/win/semmutex-win.cpp
r25704 r25711 70 70 71 71 72 /* Undefine debug mappings. */ 73 #undef RTSemMutexRequest 74 #undef RTSemMutexRequestNoResume 75 76 77 RTDECL(int) RTSemMutexCreate(PRTSEMMUTEX pMutexSem) 78 { 72 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 * Create the semaphore. 87 */ 79 88 int rc; 80 81 /*82 * Create the semaphore.83 */84 89 HANDLE hMtx = CreateMutex(NULL, FALSE, NULL); 85 90 if (hMtx) … … 93 98 pThis->cRecursions = 0; 94 99 #ifdef RTSEMMUTEX_STRICT 95 RTLockValidatorRecExclInit(&pThis->ValidatorRec, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis, 96 true /*fEnabled*/, "RTSemMutex"); 97 #endif 98 *pMutexSem = pThis; 100 va_list va; 101 va_start(va, pszNameFmt); 102 RTLockValidatorRecExclInitV(&pThis->ValidatorRec, hClass, uSubClass, pThis, 103 !(fFlags & RTSEMMUTEX_FLAGS_NO_LOCK_VAL), pszNameFmt, va); 104 va_end(va); 105 #endif 106 *phMutexSem = pThis; 99 107 return VINF_SUCCESS; 100 108 } … … 138 146 RTMemFree(pThis); 139 147 return rc; 148 } 149 150 151 RTDECL(uint32_t) RTSemMutexSetSubClass(RTSEMMUTEX hMutexSem, uint32_t uSubClass) 152 { 153 #ifdef RTSEMMUTEX_STRICT 154 /* 155 * Validate. 156 */ 157 RTSEMMUTEXINTERNAL *pThis = hMutexSem; 158 AssertPtrReturn(pThis, RTLOCKVAL_SUB_CLASS_INVALID); 159 AssertReturn(pThis->u32Magic == RTSEMMUTEX_MAGIC, RTLOCKVAL_SUB_CLASS_INVALID); 160 161 return RTLockValidatorRecExclSetSubClass(&pThis->ValidatorRec, uSubClass); 162 #else 163 return RTLOCKVAL_SUB_CLASS_INVALID; 164 #endif 140 165 } 141 166 … … 225 250 226 251 252 #undef RTSemMutexRequestNoResume 227 253 RTDECL(int) RTSemMutexRequestNoResume(RTSEMMUTEX MutexSem, unsigned cMillies) 228 254 {
Note:
See TracChangeset
for help on using the changeset viewer.