Changeset 30377 in vbox
- Timestamp:
- Jun 22, 2010 2:01:01 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/DHCPServerImpl.cpp
r28800 r30377 150 150 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 151 151 152 /* VirtualBox::saveSettings() needs a write lock */ 153 AutoMultiWriteLock2 alock(mVirtualBox, this COMMA_LOCKVAL_SRC_POS); 154 152 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 155 153 m.enabled = aEnabled; 156 154 155 // save the global settings; for that we should hold only the VirtualBox lock 156 alock.release(); 157 AutoWriteLock vboxLock(mVirtualBox COMMA_LOCKVAL_SRC_POS); 157 158 HRESULT rc = mVirtualBox->saveSettings(); 158 159 … … 218 219 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 219 220 220 /* VirtualBox::saveSettings() needs a write lock */ 221 AutoMultiWriteLock2 alock(mVirtualBox, this COMMA_LOCKVAL_SRC_POS); 222 221 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 223 222 m.IPAddress = aIPAddress; 224 223 m.networkMask = aNetworkMask; … … 226 225 m.upperIP = aUpperIP; 227 226 227 // save the global settings; for that we should hold only the VirtualBox lock 228 alock.release(); 229 AutoWriteLock vboxLock(mVirtualBox COMMA_LOCKVAL_SRC_POS); 228 230 return mVirtualBox->saveSettings(); 229 231 } -
trunk/src/VBox/Main/HostImpl.cpp
r30304 r30377 1143 1143 } 1144 1144 1145 / * save the global settings */1145 // save the global settings; for that we should hold only the VirtualBox lock 1146 1146 alock.release(); 1147 1147 AutoWriteLock vboxLock(m->pParent COMMA_LOCKVAL_SRC_POS); … … 1199 1199 } 1200 1200 1201 / * save the global settings */1201 // save the global settings; for that we should hold only the VirtualBox lock 1202 1202 alock.release(); 1203 1203 AutoWriteLock vboxLock(m->pParent COMMA_LOCKVAL_SRC_POS); … … 1764 1764 1765 1765 // save the global settings... yeah, on every single filter property change 1766 // for that we should hold only the VirtualBox lock 1766 1767 alock.release(); 1767 1768 AutoWriteLock vboxLock(m->pParent COMMA_LOCKVAL_SRC_POS); -
trunk/src/VBox/Main/MachineImpl.cpp
r30305 r30377 3163 3163 if (fNeedsSaveSettings) 3164 3164 { 3165 // save the global settings; for that we should hold only the VirtualBox lock 3165 3166 mediumLock.release(); 3166 3167 treeLock.leave(); … … 3257 3258 if (fNeedsGlobalSaveSettings) 3258 3259 { 3260 // save the global settings; for that we should hold only the VirtualBox lock 3259 3261 alock.release(); 3260 3262 AutoWriteLock vboxlock(this COMMA_LOCKVAL_SRC_POS); … … 3656 3658 if (fNeedsGlobalSaveSettings) 3657 3659 { 3660 // save the global settings; for that we should hold only the VirtualBox lock 3658 3661 alock.release(); 3659 3662 AutoWriteLock vboxlock(mParent COMMA_LOCKVAL_SRC_POS); … … 3691 3694 if (SUCCEEDED(rc) && fNeedsGlobalSaveSettings) 3692 3695 { 3696 // save the global settings; for that we should hold only the VirtualBox lock 3693 3697 AutoWriteLock vlock(mParent COMMA_LOCKVAL_SRC_POS); 3694 3698 rc = mParent->saveSettings(); … … 10799 10803 AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); 10800 10804 10801 /* saveSettings() needs mParent lock */ 10802 AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS); 10805 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 10803 10806 10804 10807 HRESULT rc = S_OK; -
trunk/src/VBox/Main/MediumImpl.cpp
r30314 r30377 1443 1443 m->type = aType; 1444 1444 1445 // save the global settings; for that we should hold only the VirtualBox lock 1445 1446 mlock.release(); 1446 1447 // saveSettings needs vbox lock1448 1447 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 1449 1450 1448 HRESULT rc = m->pVirtualBox->saveSettings(); 1451 1449 … … 1572 1570 m->autoReset = !!aAutoReset; 1573 1571 1572 // save the global settings; for that we should hold only the VirtualBox lock 1574 1573 mlock.release(); 1575 1576 // saveSettings needs vbox lock1577 1574 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 1578 1579 1575 return m->pVirtualBox->saveSettings(); 1580 1576 } … … 2014 2010 it->second = aValue; 2015 2011 2012 // save the global settings; for that we should hold only the VirtualBox lock 2016 2013 mlock.release(); 2017 2018 // saveSettings needs vbox lock2019 2014 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 2020 2015 HRESULT rc = m->pVirtualBox->saveSettings(); … … 2179 2174 2180 2175 bool fNeedsSaveSettings = false; 2181 ComObjPtr 2176 ComObjPtr<Progress> pProgress; 2182 2177 2183 2178 HRESULT rc = deleteStorage(&pProgress, … … 5210 5205 task.mVDOperationIfaces); 5211 5206 if (RT_FAILURE(vrc)) 5212 {5213 5207 throw setError(E_FAIL, 5214 5208 tr("Could not create the hard disk storage unit '%s'%s"), 5215 5209 location.raw(), vdError(vrc).raw()); 5216 }5217 5210 5218 5211 size = VDGetFileSize(hdd, 0); … … 5441 5434 if (fNeedsSaveSettings) 5442 5435 { 5436 // save the global settings; for that we should hold only the VirtualBox lock 5443 5437 mediaLock.release(); 5444 5438 AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); … … 5727 5721 { 5728 5722 // in asynchronous mode, save settings now 5723 // for that we should hold only the VirtualBox lock 5729 5724 AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 5730 5725 m->pVirtualBox->saveSettings(); -
trunk/src/VBox/Main/SnapshotImpl.cpp
r29540 r30377 1530 1530 mSnapshotData.mSnapshot.setNull(); 1531 1531 1532 // save VirtualBox.xml (media registry most probably changed with diff image) 1532 // save VirtualBox.xml (media registry most probably changed with diff image); 1533 // for that we should hold only the VirtualBox lock 1533 1534 machineLock.release(); 1534 1535 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS); -
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r30358 r30377 3531 3531 * places internally when settings need saving. 3532 3532 * 3533 * @note Caller must have locked the VirtualBox object for writing! 3533 * @note Caller must have locked the VirtualBox object for writing and must not hold any 3534 * other locks since this locks all kinds of member objects and trees temporarily, 3535 * which could cause conflicts. 3534 3536 */ 3535 3537 HRESULT VirtualBox::saveSettings() … … 4792 4794 rc = FindDHCPServerByNetworkName(name, existing.asOutParam()); 4793 4795 if (SUCCEEDED(rc)) 4794 {4795 4796 return E_INVALIDARG; 4796 }4797 4797 4798 4798 rc = S_OK; … … 4836 4836 AssertComRCReturn(autoCaller.rc(), autoCaller.rc()); 4837 4837 4838 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);4839 4840 4838 AutoCaller dhcpServerCaller(aDHCPServer); 4841 4839 AssertComRCReturn(dhcpServerCaller.rc(), dhcpServerCaller.rc());
Note:
See TracChangeset
for help on using the changeset viewer.