- Timestamp:
- Jun 1, 2010 11:09:44 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MediumImpl.cpp
r29618 r29940 1441 1441 m->type = aType; 1442 1442 1443 mlock.release(); 1444 1443 1445 // saveSettings needs vbox lock 1444 ComObjPtr<VirtualBox> pVirtualBox(m->pVirtualBox);1445 mlock.leave();1446 1446 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 1447 1447 1448 HRESULT rc = pVirtualBox->saveSettings();1448 HRESULT rc = m->pVirtualBox->saveSettings(); 1449 1449 1450 1450 return rc; … … 1559 1559 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1560 1560 1561 /* VirtualBox::saveSettings() needs a write lock */ 1562 AutoMultiWriteLock2 alock(m->pVirtualBox, this COMMA_LOCKVAL_SRC_POS); 1561 AutoWriteLock mlock(this COMMA_LOCKVAL_SRC_POS); 1563 1562 1564 1563 if (m->pParent.isNull()) … … 1570 1569 { 1571 1570 m->autoReset = !!aAutoReset; 1571 1572 mlock.release(); 1573 1574 // saveSettings needs vbox lock 1575 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 1572 1576 1573 1577 return m->pVirtualBox->saveSettings(); … … 1980 1984 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 1981 1985 1982 /* VirtualBox::saveSettings() needs a write lock */ 1983 AutoMultiWriteLock2 alock(m->pVirtualBox, this COMMA_LOCKVAL_SRC_POS); 1986 AutoWriteLock mlock(this COMMA_LOCKVAL_SRC_POS); 1984 1987 1985 1988 switch (m->state) … … 2003 2006 it->second = aValue; 2004 2007 2008 mlock.release(); 2009 2010 // saveSettings needs vbox lock 2011 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 2005 2012 HRESULT rc = m->pVirtualBox->saveSettings(); 2006 2013 … … 2051 2058 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 2052 2059 2053 /* VirtualBox::saveSettings() needs a write lock */ 2054 AutoMultiWriteLock2 alock(m->pVirtualBox, this COMMA_LOCKVAL_SRC_POS); 2060 AutoWriteLock mlock(this COMMA_LOCKVAL_SRC_POS); 2055 2061 2056 2062 com::SafeArray<IN_BSTR> names(ComSafeArrayInArg(aNames)); … … 2081 2087 } 2082 2088 2089 mlock.release(); 2090 2091 // saveSettings needs vbox lock 2092 AutoWriteLock alock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 2083 2093 HRESULT rc = m->pVirtualBox->saveSettings(); 2084 2094 … … 3449 3459 3450 3460 alock.leave(); 3451 3452 3461 vrc = RTSemEventMultiWait(m->queryInfoSem, RT_INDEFINITE_WAIT); 3453 3454 3462 alock.enter(); 3455 3463 … … 5161 5169 5162 5170 /* unlock before the potentially lengthy operation */ 5163 thisLock. leave();5171 thisLock.release(); 5164 5172 5165 5173 try … … 5295 5303 /* the two media are now protected by their non-default states; 5296 5304 * unlock the media before the potentially lengthy operation */ 5297 mediaLock. leave();5305 mediaLock.release(); 5298 5306 5299 5307 try … … 5412 5420 if (fNeedsSaveSettings) 5413 5421 { 5414 mediaLock. leave();5422 mediaLock.release(); 5415 5423 AutoWriteLock vboxlock(m->pVirtualBox COMMA_LOCKVAL_SRC_POS); 5416 5424 m->pVirtualBox->saveSettings(); … … 5817 5825 5818 5826 /* unlock before the potentially lengthy operation */ 5819 thisLock. leave();5827 thisLock.release(); 5820 5828 5821 5829 /* ensure the target directory exists */ … … 6238 6246 6239 6247 /* unlock before the potentially lengthy operation */ 6240 thisLock. leave();6248 thisLock.release(); 6241 6249 6242 6250 vrc = VDCompact(hdd, VD_LAST_IMAGE, task.mVDOperationIfaces);
Note:
See TracChangeset
for help on using the changeset viewer.