- Timestamp:
- Mar 15, 2012 3:45:42 PM (13 years ago)
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r40432 r40487 3802 3802 // put the parent in the machine registry then 3803 3803 mediumLock.release(); 3804 treeLock.release(); 3804 3805 addMediumToRegistry(medium); 3806 treeLock.acquire(); 3805 3807 mediumLock.acquire(); 3806 3808 medium->getFirstRegistryMachineId(uuidRegistryParent); … … 3895 3897 3896 3898 mediumLock.release(); 3899 treeLock.release(); 3897 3900 addMediumToRegistry(medium); 3901 treeLock.acquire(); 3898 3902 mediumLock.acquire(); 3899 3903 } … … 4303 4307 aControllerPort, 4304 4308 aDevice); 4305 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS);4306 4309 if (!oldmedium.isNull()) 4307 4310 oldmedium->removeBackReference(mData->mUuid); … … 4311 4314 4312 4315 mediumLock.release(); 4316 multiLock.release(); 4313 4317 addMediumToRegistry(pMedium); 4318 multiLock.acquire(); 4314 4319 mediumLock.acquire(); 4315 4320 } 4316 4321 4322 AutoWriteLock attLock(pAttach COMMA_LOCKVAL_SRC_POS); 4317 4323 pAttach->updateMedium(pMedium); 4318 4324 } -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r40432 r40487 1271 1271 AutoReadLock mlock2(pParent COMMA_LOCKVAL_SRC_POS); 1272 1272 if (pParent->getFirstRegistryMachineId(uuid)) 1273 { 1274 mlock2.release(); 1275 trgLock.release(); 1276 srcLock.release(); 1273 1277 p->mParent->markRegistryModified(uuid); 1278 srcLock.acquire(); 1279 trgLock.acquire(); 1280 mlock2.acquire(); 1281 } 1274 1282 } 1275 1283 mlock.acquire(); -
trunk/src/VBox/Main/src-server/MediumImpl.cpp
r40475 r40487 1742 1742 1743 1743 // save the settings 1744 markRegistriesModified();1745 1744 mlock.release(); 1746 1745 treeLock.release(); 1746 markRegistriesModified(); 1747 1747 m->pVirtualBox->saveModifiedRegistries(); 1748 1748 … … 1886 1886 1887 1887 // save the settings 1888 mlock.release(); 1888 1889 markRegistriesModified(); 1889 mlock.release();1890 1890 m->pVirtualBox->saveModifiedRegistries(); 1891 1891 } … … 2349 2349 2350 2350 // save the settings 2351 mlock.release(); 2351 2352 markRegistriesModified(); 2352 mlock.release();2353 2353 m->pVirtualBox->saveModifiedRegistries(); 2354 2354 … … 2426 2426 2427 2427 // save the settings 2428 mlock.release(); 2428 2429 markRegistriesModified(); 2429 mlock.release();2430 2430 m->pVirtualBox->saveModifiedRegistries(); 2431 2431 … … 2581 2581 /* since this medium has been just created it isn't associated yet */ 2582 2582 diff->m->llRegistryIDs.push_back(parentMachineRegistry); 2583 alock.release(); 2583 2584 diff->markRegistriesModified(); 2585 alock.acquire(); 2584 2586 } 2585 2587 … … 3324 3326 if (FAILED(autoCaller.rc())) return; 3325 3327 3326 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 3327 3328 for (GuidList::const_iterator it = m->llRegistryIDs.begin(); 3329 it != m->llRegistryIDs.end(); 3328 // Get local copy, as keeping the lock over VirtualBox::markRegistryModified 3329 // causes trouble with the lock order 3330 GuidList llRegistryIDs; 3331 { 3332 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 3333 llRegistryIDs = m->llRegistryIDs; 3334 } 3335 3336 for (GuidList::const_iterator it = llRegistryIDs.begin(); 3337 it != llRegistryIDs.end(); 3330 3338 ++it) 3331 3339 { … … 6528 6536 m->variant = variant; 6529 6537 6538 thisLock.release(); 6530 6539 markRegistriesModified(); 6531 6540 if (task.isAsync()) 6532 6541 { 6533 6542 // in asynchronous mode, save settings now 6534 thisLock.release();6535 6543 m->pVirtualBox->saveModifiedRegistries(); 6536 6544 } … … 6732 6740 --m->numCreateDiffTasks; 6733 6741 6742 mediaLock.release(); 6734 6743 markRegistriesModified(); 6735 6744 if (task.isAsync()) 6736 6745 { 6737 6746 // in asynchronous mode, save settings now 6738 mediaLock.release();6739 6747 m->pVirtualBox->saveModifiedRegistries(); 6740 6748 } -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r40432 r40487 1940 1940 } 1941 1941 1942 // release the locks before updating registry and deleting image files 1943 alock.release(); 1944 1942 1945 // save machine settings, reset the modified flag and commit; 1943 1946 bool fNeedsGlobalSaveSettings = false; … … 1950 1953 mParent->markRegistryModified(mParent->getGlobalRegistryId()); 1951 1954 1952 // let go of the locks while we're deleting image files below1953 alock.release();1954 1955 // from here on we cannot roll back on failure any more 1955 1956 … … 2493 2494 2494 2495 // machine will need saving now 2496 machineLock.release(); 2495 2497 mParent->markRegistryModified(getId()); 2496 2498 } … … 2685 2687 aTask.pSnapshot->uninit(); 2686 2688 2689 machineLock.release(); 2687 2690 mParent->markRegistryModified(getId()); 2688 2691 } -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r40432 r40487 3829 3829 pMedium->addRegistry(*puuidBetter, true /* fRecurse */); 3830 3830 // 3) and make sure the registry is saved below 3831 mlock.release(); 3832 tlock.release(); 3831 3833 markRegistryModified(*puuidBetter); 3834 tlock.acquire(); 3835 mlock.release(); 3832 3836 } 3833 3837 }
Note:
See TracChangeset
for help on using the changeset viewer.