Changeset 25704 in vbox for trunk/src/VBox/Runtime/generic
- Timestamp:
- Jan 10, 2010 8:12:30 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 56439
- Location:
- trunk/src/VBox/Runtime/generic
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/generic/critsect-generic.cpp
r25685 r25704 53 53 54 54 55 RTDECL(int) RTCritSectInitEx(PRTCRITSECT pCritSect, uint32_t fFlags, RTLOCKVALCLASS hClass, uint32_t uSubClass, const char *pszName) 55 RTDECL(int) RTCritSectInitEx(PRTCRITSECT pCritSect, uint32_t fFlags, RTLOCKVALCLASS hClass, uint32_t uSubClass, 56 const char *pszNameFmt, ...) 56 57 { 57 58 AssertReturn(fFlags <= (RTCRITSECT_FLAGS_NO_NESTING | RTCRITSECT_FLAGS_NO_LOCK_VAL), VERR_INVALID_PARAMETER); … … 65 66 pCritSect->cLockers = -1; 66 67 pCritSect->NativeThreadOwner = NIL_RTNATIVETHREAD; 67 int rc = RTLockValidatorRecExclCreate(&pCritSect->pValidatorRec, hClass, uSubClass, pszName, 68 pCritSect, !(fFlags & RTCRITSECT_FLAGS_NO_LOCK_VAL)); 68 #ifndef RTCRITSECT_STRICT 69 pCritSect->pValidatorRec = NULL; 70 int rc = VINF_SUCCESS; 71 #else 72 va_list va; 73 va_start(va, pszNameFmt); 74 int rc = RTLockValidatorRecExclCreateV(&pCritSect->pValidatorRec, hClass, uSubClass, pCritSect, 75 !(fFlags & RTCRITSECT_FLAGS_NO_LOCK_VAL), pszNameFmt, va); 76 va_end(va); 77 #endif 69 78 if (RT_SUCCESS(rc)) 70 79 { … … 81 90 } 82 91 RT_EXPORT_SYMBOL(RTCritSectInitEx); 92 93 94 RTDECL(uint32_t) RTCritSectSetSubClass(PRTCRITSECT pCritSect, uint32_t uSubClass) 95 { 96 #ifdef RTCRITSECT_STRICT 97 AssertPtrReturn(pCritSect, RTLOCKVAL_SUB_CLASS_INVALID); 98 AssertReturn(pCritSect->u32Magic == RTCRITSECT_MAGIC, RTLOCKVAL_SUB_CLASS_INVALID); 99 return RTLockValidatorRecExclSetSubClass(pCritSect->pValidatorRec, uSubClass); 100 #else 101 return RTLOCKVAL_SUB_CLASS_INVALID; 102 #endif 103 } 83 104 84 105 -
trunk/src/VBox/Runtime/generic/semrw-generic.cpp
r25685 r25704 135 135 pThis->u32Magic = RTSEMRW_MAGIC; 136 136 #ifdef RTSEMRW_STRICT 137 RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, true); 138 RTLockValidatorRecSharedInit(&pThis->ValidatorRead, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, false /*fSignaller*/, true); 137 RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis, 138 true /*fEnabled*/, "RTSemRW"); 139 RTLockValidatorRecSharedInit(&pThis->ValidatorRead, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis, 140 false /*fSignaller*/, true /*fEnabled*/, "RTSemEvent"); 139 141 RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core); 140 142 #endif -
trunk/src/VBox/Runtime/generic/semrw-lockless-generic.cpp
r25685 r25704 134 134 pThis->fNeedReset = false; 135 135 #ifdef RTSEMRW_STRICT 136 RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, true); 137 RTLockValidatorRecSharedInit(&pThis->ValidatorRead, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, "RTSemRW", pThis, false /*fSignaller*/, true); 136 RTLockValidatorRecExclInit(&pThis->ValidatorWrite, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis, 137 true /*fEnabled*/, "RTSemRW"); 138 RTLockValidatorRecSharedInit(&pThis->ValidatorRead, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_NONE, pThis, 139 false /*fSignaller*/, true /*fEnabled*/, "RTSemEvent"); 138 140 RTLockValidatorRecMakeSiblings(&pThis->ValidatorWrite.Core, &pThis->ValidatorRead.Core); 139 141 #endif
Note:
See TracChangeset
for help on using the changeset viewer.