Changeset 106077 in vbox for trunk/src/VBox
- Timestamp:
- Sep 17, 2024 7:36:17 PM (3 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 7 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 -
trunk/src/VBox/Main/src-all/VirtualBoxBase.cpp
r106061 r106077 195 195 // getLockingClass() is overridden by many subclasses to return 196 196 // one of the locking classes listed at the top of AutoLock.h 197 RWLockHandle *objLock = new RWLockHandle(getLockingClass()); 197 // getComponentName() returns the class name by default. 198 RWLockHandle *objLock = new RWLockHandle(getLockingClass(), getComponentName()); 198 199 if (!ASMAtomicCmpXchgPtr(&mObjectLock, objLock, NULL)) 199 200 { -
trunk/src/VBox/Main/src-all/VirtualBoxTranslator.cpp
r106061 r106077 147 147 148 148 VirtualBoxTranslator::VirtualBoxTranslator() 149 : util::RWLockHandle(util::LOCKCLASS_TRANSLATOR )149 : util::RWLockHandle(util::LOCKCLASS_TRANSLATOR, "VirtualBoxTranslator") 150 150 , m_cInstanceRefs(0) 151 151 , m_pDefaultComponent(NULL) -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r106061 r106077 431 431 #endif 432 432 , mBusMgr(NULL) 433 , mLedLock(LOCKCLASS_LISTOFOTHEROBJECTS /* must be higher than LOCKCLASS_OTHEROBJECT */ )433 , mLedLock(LOCKCLASS_LISTOFOTHEROBJECTS /* must be higher than LOCKCLASS_OTHEROBJECT */, "LedLock") 434 434 , muLedGen(0) 435 435 , muLedTypeGen(0) -
trunk/src/VBox/Main/src-server/ClientWatcher.cpp
r106061 r106077 55 55 56 56 VirtualBox::ClientWatcher::ClientWatcher() : 57 mLock(LOCKCLASS_OBJECTSTATE )57 mLock(LOCKCLASS_OBJECTSTATE, "ClientWatcher") 58 58 { 59 59 AssertReleaseFailed(); … … 92 92 mThread(NIL_RTTHREAD), 93 93 mUpdateReq(CWUPDATEREQARG), 94 mLock(LOCKCLASS_OBJECTSTATE )94 mLock(LOCKCLASS_OBJECTSTATE, "ClientWatcher") 95 95 { 96 96 #if defined(RT_OS_WINDOWS) -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r106061 r106077 178 178 readers(0), 179 179 preLockState(MediumState_NotCreated), 180 queryInfoSem(LOCKCLASS_MEDIUMQUERY ),180 queryInfoSem(LOCKCLASS_MEDIUMQUERY, "queryInfoSem"), 181 181 queryInfoRunning(false), 182 182 type(MediumType_Normal), -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r106061 r106077 293 293 , uuidMediaRegistry("48024e5c-fdd9-470f-93af-ec29f7ea518c") 294 294 , uRegistryNeedsSaving(0) 295 , lockMachines(LOCKCLASS_LISTOFMACHINES )295 , lockMachines(LOCKCLASS_LISTOFMACHINES, "Machines") 296 296 , allMachines(lockMachines) 297 , lockGuestOSTypes(LOCKCLASS_LISTOFOTHEROBJECTS )297 , lockGuestOSTypes(LOCKCLASS_LISTOFOTHEROBJECTS, "GuestOSTypes") 298 298 , allGuestOSTypes(lockGuestOSTypes) 299 , lockMedia(LOCKCLASS_LISTOFMEDIA )299 , lockMedia(LOCKCLASS_LISTOFMEDIA, "Media") 300 300 , allHardDisks(lockMedia) 301 301 , allDVDImages(lockMedia) 302 302 , allFloppyImages(lockMedia) 303 , lockSharedFolders(LOCKCLASS_LISTOFOTHEROBJECTS )303 , lockSharedFolders(LOCKCLASS_LISTOFOTHEROBJECTS, "SharedFolders") 304 304 , allSharedFolders(lockSharedFolders) 305 , lockDHCPServers(LOCKCLASS_LISTOFOTHEROBJECTS )305 , lockDHCPServers(LOCKCLASS_LISTOFOTHEROBJECTS, "DHCPServers") 306 306 , allDHCPServers(lockDHCPServers) 307 , lockNATNetworks(LOCKCLASS_LISTOFOTHEROBJECTS )307 , lockNATNetworks(LOCKCLASS_LISTOFOTHEROBJECTS, "NATNetworks") 308 308 , allNATNetworks(lockNATNetworks) 309 309 #ifdef VBOX_WITH_VMNET 310 , lockHostOnlyNetworks(LOCKCLASS_LISTOFOTHEROBJECTS )310 , lockHostOnlyNetworks(LOCKCLASS_LISTOFOTHEROBJECTS, "HostOnlyNetworks") 311 311 , allHostOnlyNetworks(lockHostOnlyNetworks) 312 312 #endif /* VBOX_WITH_VMNET */ 313 313 #ifdef VBOX_WITH_CLOUD_NET 314 , lockCloudNetworks(LOCKCLASS_LISTOFOTHEROBJECTS )314 , lockCloudNetworks(LOCKCLASS_LISTOFOTHEROBJECTS, "CloudNetworks") 315 315 , allCloudNetworks(lockCloudNetworks) 316 316 #endif /* VBOX_WITH_CLOUD_NET */ 317 , mtxProgressOperations(LOCKCLASS_PROGRESSLIST )317 , mtxProgressOperations(LOCKCLASS_PROGRESSLIST, "ProgressOperations") 318 318 , pClientWatcher(NULL) 319 319 , threadAsyncEvent(NIL_RTTHREAD) … … 558 558 sAPIVersion = VBOX_API_VERSION_STRING; 559 559 if (!spMtxNatNetworkNameToRefCountLock) 560 spMtxNatNetworkNameToRefCountLock = new RWLockHandle(LOCKCLASS_VIRTUALBOXOBJECT );560 spMtxNatNetworkNameToRefCountLock = new RWLockHandle(LOCKCLASS_VIRTUALBOXOBJECT, "spMtxNatNetworkNameToRefCountLock"); 561 561 562 562 LogFlowThisFunc(("Version: %s, Package: %s, API Version: %s\n", sVersion.c_str(), sPackageType.c_str(), sAPIVersion.c_str()));
Note:
See TracChangeset
for help on using the changeset viewer.