Changeset 106077 in vbox for trunk/src/VBox/Main/glue
- Timestamp:
- Sep 17, 2024 7:36:17 PM (4 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/glue/AutoLock.cpp
r106061 r106077 168 168 }; 169 169 170 RWLockHandle::RWLockHandle(VBoxLockingClass lockClass) 171 { 170 RWLockHandle::RWLockHandle(VBoxLockingClass lockClass, const char *pszName /*= NULL*/) 171 { 172 Assert(!pszName || (!strchr(pszName, '%') && *pszName)); 172 173 m = new Data(); 173 174 174 175 m->lockClass = lockClass; 175 176 #ifdef VBOX_WITH_MAIN_LOCK_VALIDATION 176 m->strDescription.printf("r/w %RCv", this); 177 if (pszName) 178 m->strDescription.printf("r/w %RCv %s", this, pszName); 179 else 180 m->strDescription.printf("r/w %RCv", this); 177 181 #endif 178 182 179 183 #ifdef GLUE_USE_CRITSECTRW 180 184 # ifdef VBOX_WITH_MAIN_LOCK_VALIDATION 181 int vrc = RTCritSectRwInitEx(&m->CritSect, 0 /*fFlags*/, g_mapLockValidationClasses[lockClass], RTLOCKVAL_SUB_CLASS_ANY, NULL);185 int vrc = RTCritSectRwInitEx(&m->CritSect, 0 /*fFlags*/, g_mapLockValidationClasses[lockClass], RTLOCKVAL_SUB_CLASS_ANY, pszName); 182 186 # else 183 int vrc = RTCritSectRwInitEx(&m->CritSect, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY, NULL);187 int vrc = RTCritSectRwInitEx(&m->CritSect, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY, pszName); 184 188 # endif 185 189 #else 186 190 # ifdef VBOX_WITH_MAIN_LOCK_VALIDATION 187 int vrc = RTSemRWCreateEx(&m->sem, 0 /*fFlags*/, g_mapLockValidationClasses[lockClass], RTLOCKVAL_SUB_CLASS_ANY, NULL);191 int vrc = RTSemRWCreateEx(&m->sem, 0 /*fFlags*/, g_mapLockValidationClasses[lockClass], RTLOCKVAL_SUB_CLASS_ANY, pszName); 188 192 # else 189 int vrc = RTSemRWCreateEx(&m->sem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY, NULL);193 int vrc = RTSemRWCreateEx(&m->sem, 0 /*fFlags*/, NIL_RTLOCKVALCLASS, RTLOCKVAL_SUB_CLASS_ANY, pszName); 190 194 # endif 191 195 #endif
Note:
See TracChangeset
for help on using the changeset viewer.