Changeset 78072 in vbox
- Timestamp:
- Apr 10, 2019 10:04:06 AM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 129928
- Location:
- trunk/src/VBox/Main/src-server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r77910 r78072 1947 1947 HRESULT Machine::getRecordingSettings(ComPtr<IRecordingSettings> &aRecordingSettings) 1948 1948 { 1949 /* mRecordingSettings is constant during life time, no need to lock */ 1949 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1950 1950 1951 aRecordingSettings = mRecordingSettings; 1951 1952 -
trunk/src/VBox/Main/src-server/RecordingScreenSettingsImpl.cpp
r78070 r78072 140 140 unconst(m->pPeer) = aThat; 141 141 142 AutoWriteLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); 142 AutoCaller thatCaller(aThat); 143 AssertComRCReturnRC(thatCaller.rc()); 144 145 AutoReadLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); 143 146 144 147 m->uScreenId = aThat->m->uScreenId; … … 183 186 /* mPeer is left null. */ 184 187 185 AutoWriteLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); 188 AutoCaller thatCaller(aThat); 189 AssertComRCReturnRC(thatCaller.rc()); 190 191 AutoReadLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); 186 192 187 193 m->uScreenId = aThat->m->uScreenId; -
trunk/src/VBox/Main/src-server/RecordingSettingsImpl.cpp
r78071 r78072 100 100 * @note This object must be destroyed before the original object 101 101 * it shares data with is destroyed. 102 * 103 * @note Locks @a aThat object for reading. 102 104 */ 103 105 HRESULT RecordingSettings::init(Machine *aParent, RecordingSettings *aThat) … … 117 119 unconst(m->pPeer) = aThat; 118 120 119 AutoWriteLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); 121 AutoCaller thatCaller(aThat); 122 AssertComRCReturnRC(thatCaller.rc()); 123 124 AutoReadLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); 120 125 121 126 m->bd.share(aThat->m->bd); … … 132 137 * (a kind of copy constructor). This object makes a private copy of data 133 138 * of the original object passed as an argument. 139 * 140 * @note Locks @a aThat object for reading. 134 141 */ 135 142 HRESULT RecordingSettings::initCopy(Machine *aParent, RecordingSettings *aThat) … … 149 156 // mPeer is left null 150 157 151 Auto WriteLock thatlock(aThat COMMA_LOCKVAL_SRC_POS);158 AutoReadLock thatlock(aThat COMMA_LOCKVAL_SRC_POS); 152 159 153 160 m->bd.attachCopy(aThat->m->bd); … … 201 208 HRESULT RecordingSettings::setEnabled(BOOL enable) 202 209 { 203 LogFlowThisFuncEnter(); 210 /* the machine needs to be mutable */ 211 AutoMutableOrSavedOrRunningStateDependency adep(m->pMachine); 212 if (FAILED(adep.rc())) return adep.rc(); 204 213 205 214 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); … … 215 224 216 225 alock.release(); 226 217 227 rc = m->pMachine->i_onRecordingChange(enable); 218 228 if (FAILED(rc)) … … 232 242 m->pMachine->i_setModified(Machine::IsModified_Recording); 233 243 244 /* Make sure to release the mutable dependency lock from above before 245 * actually saving the settings. */ 246 adep.release(); 247 234 248 /** Save settings if online - @todo why is this required? -- @bugref{6818} */ 235 249 if (Global::IsOnline(m->pMachine->i_getMachineState())) … … 492 506 void RecordingSettings::i_rollback() 493 507 { 508 /* sanity */ 509 AutoCaller autoCaller(this); 510 AssertComRCReturnVoid(autoCaller.rc()); 511 494 512 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 495 513 m->bd.rollback(); … … 516 534 { 517 535 /* attach new data to the peer and reshare it */ 518 AutoWriteLock peerlock(m->pPeer COMMA_LOCKVAL_SRC_POS);519 536 m->pPeer->m->bd.attach(m->bd); 520 537 }
Note:
See TracChangeset
for help on using the changeset viewer.