VirtualBox

Changeset 26738 in vbox for trunk


Ignore:
Timestamp:
Feb 24, 2010 11:27:45 AM (15 years ago)
Author:
vboxsync
Message:

Main: fix locking order violation in Machine::AttachDevice()

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/MachineImpl.cpp

    r26704 r26738  
    24132413    bool fNeedsSaveSettings = false;
    24142414
    2415     /* protect the media tree all the while we're in here, as well as our member variables */
    2416     AutoMultiWriteLock2 alock(this->lockHandle(), &mParent->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
     2415    // request the host lock first, since might be calling Host methods for getting host drives;
     2416    // next, protect the media tree all the while we're in here, as well as our member variables
     2417    AutoMultiWriteLock3 alock(mParent->host()->lockHandle(),
     2418                              this->lockHandle(),
     2419                              &mParent->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    24172420
    24182421    HRESULT rc = checkStateDependency(MutableStateDep);
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