VirtualBox

Changeset 38741 in vbox


Ignore:
Timestamp:
Sep 13, 2011 2:47:57 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
74012
Message:

Main/Medium: all remaining changes to get the media tree lock order issues sorted in this file (I hope).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r38729 r38741  
    26472647    {
    26482648        // locking: we need the tree lock first because we access parent pointers
    2649         AutoReadLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    26502649        // and we need to write-lock the media involved
    2651         AutoMultiWriteLock3 alock(this, pTarget, pParent COMMA_LOCKVAL_SRC_POS);
     2650        AutoMultiWriteLock4 alock(&m->pVirtualBox->getMediaTreeLockHandle(),
     2651                                  this->lockHandle(),
     2652                                  pTarget->lockHandle(),
     2653                                  pParent->LockHandle() COMMA_LOCKVAL_SRC_POS);
    26522654
    26532655        if (    pTarget->m->state != MediumState_NotCreated
     
    43984400    {
    43994401        // locking: we need the tree lock first because we access parent pointers
    4400         AutoReadLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
     4402        AutoWriteLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    44014403
    44024404        /* more sanity checking and figuring out the merge direction */
     
    49774979    {
    49784980        // locking: we need the tree lock first because we access parent pointers
    4979         AutoReadLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    49804981        // and we need to write-lock the media involved
    4981         AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
     4982        AutoMultiWriteLock2 alock(&m->pVirtualBox->getMediaTreeLockHandle(),
     4983                                  this->lockHandle() COMMA_LOCKVAL_SRC_POS);
    49824984
    49834985        /* Build the source lock list. */
     
    50565058    {
    50575059        // locking: we need the tree lock first because we access parent pointers
    5058         AutoReadLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    50595060        // and we need to write-lock the media involved
    5060         AutoMultiWriteLock2 alock(this, aParent COMMA_LOCKVAL_SRC_POS);
     5061        AutoMultiWriteLock3 alock(&m->pVirtualBox->getMediaTreeLockHandle(),
     5062                                 this->lockHandle(),
     5063                                 aParent->lockHandle() COMMA_LOCKVAL_SRC_POS);
    50615064
    50625065        if (   m->state != MediumState_NotCreated
     
    51435146    {
    51445147        // locking: we need the tree lock first because we access parent pointers
    5145         AutoReadLock treeLock(m->pVirtualBox->getMediaTreeLockHandle() COMMA_LOCKVAL_SRC_POS);
    51465148        // and we need to write-lock the media involved
    5147         AutoMultiWriteLock3 alock(this, aTarget, aParent COMMA_LOCKVAL_SRC_POS);
     5149        AutoMultiWriteLock4 alock(&m->pVirtualBox->getMediaTreeLockHandle(),
     5150                                  this->lockHandle(),
     5151                                  aTarget->lockHandle(),
     5152                                  aParent->lockHandle() COMMA_LOCKVAL_SRC_POS);
    51485153
    51495154        if (    aTarget->m->state != MediumState_NotCreated
Note: See TracChangeset for help on using the changeset viewer.

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