Changeset 25843 in vbox
- Timestamp:
- Jan 14, 2010 6:51:32 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/MachineImpl.cpp
r25834 r25843 96 96 97 97 Machine::Data::Data() 98 : mSnapshotsTreeLockHandle(LOCKCLASS_ OTHERLIST)98 : mSnapshotsTreeLockHandle(LOCKCLASS_MACHINELIST) 99 99 { 100 100 mRegistered = FALSE; … … 631 631 LogFlowThisFunc(("mRegistered=%d\n", mData->mRegistered)); 632 632 633 /* Enter this object lock because there may be a SessionMachine instance 634 * somewhere around, that shares our data and lock but doesn't use our 635 * addCaller()/removeCaller(), and it may be also accessing the same data 636 * members. mParent lock is necessary as well because of 637 * SessionMachine::uninit(), etc. 638 */ 639 AutoMultiWriteLock2 alock(mParent, this COMMA_LOCKVAL_SRC_POS); 633 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 640 634 641 635 if (!mData->mSession.mMachine.isNull()) … … 653 647 * still valid). We'll call it ourselves below. 654 648 */ 655 LogWarningThisFunc(("Session machine is not NULL (%p), " 656 "the direct session is still open!\n", 657 (SessionMachine *) mData->mSession.mMachine)); 658 659 if (Global::IsOnlineOrTransient (mData->mMachineState)) 649 LogWarningThisFunc(("Session machine is not NULL (%p), the direct session is still open!\n", 650 (SessionMachine*)mData->mSession.mMachine)); 651 652 if (Global::IsOnlineOrTransient(mData->mMachineState)) 660 653 { 661 654 LogWarningThisFunc(("Setting state to Aborted!\n")); 662 655 /* set machine state using SessionMachine reimplementation */ 663 static_cast <Machine *> (mData->mSession.mMachine) 664 ->setMachineState (MachineState_Aborted); 656 static_cast<Machine*>(mData->mSession.mMachine)->setMachineState (MachineState_Aborted); 665 657 } 666 658 … … 671 663 mData->mSession.mMachine->uninit(); 672 664 /* SessionMachine::uninit() must set mSession.mMachine to null */ 673 Assert 665 Assert(mData->mSession.mMachine.isNull()); 674 666 } 675 667 … … 9741 9733 * filter for the given USB device and @c false otherwise. 9742 9734 * 9743 * @note Locks this object for reading.9735 * @note Caller must have requested machine read lock. 9744 9736 */ 9745 9737 bool SessionMachine::hasMatchingUSBFilter (const ComObjPtr<HostUSBDevice> &aDevice, ULONG *aMaskedIfs) … … 9751 9743 return false; 9752 9744 9753 A utoReadLock alock(this COMMA_LOCKVAL_SRC_POS);9745 AssertReturn(isWriteLockOnCurrentThread(), false); 9754 9746 9755 9747 #ifdef VBOX_WITH_USB -
trunk/src/VBox/Main/MediumImpl.cpp
r25836 r25843 1256 1256 * uninit() methods. 1257 1257 * 1258 * @note Locks getTreeLock() for writing, VirtualBox for writing.1258 * @note Caller must hold the tree lock of the medium tree this medium is on. 1259 1259 */ 1260 1260 void Medium::uninit() … … 1281 1281 else 1282 1282 { 1283 /* we uninit children and reset mParent1284 * and VirtualBox::removeDependentChild() needs a write lock */1285 AutoWriteLock alock1(m->pVirtualBox->lockHandle() COMMA_LOCKVAL_SRC_POS);1286 AutoWriteLock alock2(m->pVirtualBox->hardDiskTreeLockHandle() COMMA_LOCKVAL_SRC_POS);1287 1288 1283 MediaList::iterator it; 1289 1284 for (it = m->llChildren.begin(); … … 3055 3050 if (FAILED(autoCaller.rc())) return autoCaller.rc(); 3056 3051 3057 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);3058 3059 3052 /* we access mParent */ 3060 3053 AutoReadLock treeLock(m->pVirtualBox->hardDiskTreeLockHandle() COMMA_LOCKVAL_SRC_POS); 3054 3055 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 3061 3056 3062 3057 data.uuid = m->id; -
trunk/src/VBox/Main/NetworkAdapterImpl.cpp
r25346 r25843 906 906 AutoCaller autoCaller(this); 907 907 AssertComRCReturnRC(autoCaller.rc()); 908 909 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);910 908 911 909 /* Note: we assume that the default values for attributes of optional
Note:
See TracChangeset
for help on using the changeset viewer.