VirtualBox

Changeset 16981 in vbox


Ignore:
Timestamp:
Feb 20, 2009 11:21:42 PM (16 years ago)
Author:
vboxsync
Message:

Main: Fixed the potential deadlock in Machine::openSession() when opening a session fails for some reason (#3653).

File:
1 edited

Legend:

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

    r16966 r16981  
    34303430    AssertComRC (rc);
    34313431
     3432    /* NOTE: doing return from this function after this point but
     3433     * before the end is forbidden since it may call SessionMachine::uninit()
     3434     * (through the ComObjPtr's destructor) which requests the VirtualBox write
     3435     * lock while still holding the Machine lock in alock so that a deadlock
     3436     * is possible due to the wrong lock order. */
     3437
    34323438    if (SUCCEEDED (rc))
    34333439    {
     
    35623568        mData->mSession.mProgress.setNull();
    35633569    }
     3570
     3571    /* Leave the lock since SessionMachine::uninit() locks VirtualBox which
     3572     * would break the lock order */
     3573    alock.leave();
    35643574
    35653575    /* uninitialize the created session machine on failure */
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