VirtualBox

Changeset 15318 in vbox for trunk/src/VBox/Main/include


Ignore:
Timestamp:
Dec 11, 2008 5:27:02 PM (16 years ago)
Author:
vboxsync
Message:

Main: Fixed a deadlock in VBoxSVC when attaching a hard disk indirectly, through creating a new diff for it.

Location:
trunk/src/VBox/Main/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/HardDisk2Impl.h

    r15051 r15318  
    224224     *    object lock.
    225225     */
    226     RWLockHandle *treeLock() { return mVirtualBox->hardDiskTreeHandle(); }
     226    RWLockHandle *treeLock() { return mVirtualBox->hardDiskTreeLockHandle(); }
    227227
    228228    /** Reimplements VirtualBoxWithTypedChildren::childrenLock() to return
  • trunk/src/VBox/Main/include/VirtualBoxImpl.h

    r15051 r15318  
    362362     *    object lock.
    363363     */
    364     RWLockHandle *hardDiskTreeHandle() { return &mHardDiskTreeHandle; }
     364    RWLockHandle *hardDiskTreeLockHandle() { return &mHardDiskTreeLockHandle; }
    365365
    366366    /* for VirtualBoxSupportErrorInfoImpl */
     
    380380
    381381    typedef std::map <Guid, ComObjPtr <HardDisk2> > HardDisk2Map;
     382
     383    /**
     384     * Reimplements VirtualBoxWithTypedChildren::childrenLock() to return a
     385     * dedicated lock instead of the main object lock. The dedicated lock for
     386     * child map operations frees callers of init() methods of these children
     387     * from acquiring a write parent (VirtualBox) lock (which would be mandatory
     388     * otherwise). Since VirtualBox has a lot of heterogenous children which
     389     * init() methods are called here and there, it definitely makes sense.
     390     */
     391    RWLockHandle *childrenLock() { return &mChildrenMapLockHandle; }
    382392
    383393    HRESULT checkMediaForConflicts2 (const Guid &aId, const Bstr &aLocation,
     
    490500    RWLockHandle mSafeLock;
    491501
    492     RWLockHandle mHardDiskTreeHandle;
     502    RWLockHandle mHardDiskTreeLockHandle;
     503    RWLockHandle mChildrenMapLockHandle;
    493504
    494505    static Bstr sVersion;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette