VirtualBox

Changeset 51903 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Jul 7, 2014 1:03:49 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
94779
Message:

Main: AutoCaller/VirtualBoxBase refactoring, cleanly splitting out the object state handling, and moving all caller synchronization to one file. Also eliminated a not so vital template (AutoCallerBase) by much simpler inheritance. Theoretically has no visible effects, the behavior should be identical. Done as a preparation for reimplementing the caller synchronization.

Location:
trunk/src/VBox/Main/src-client
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/ConsoleImpl.cpp

    r51765 r51903  
    71777177
    71787178    LogRel(("Console::powerDown(): A request to power off the VM has been issued (mMachineState=%s, InUninit=%d)\n",
    7179             Global::stringifyMachineState(mMachineState), autoCaller.state() == InUninit));
     7179            Global::stringifyMachineState(mMachineState), getObjectState().getState() == ObjectState::InUninit));
    71807180
    71817181    /* Check if we need to power off the VM. In case of mVMPoweredOff=true, the
     
    73207320    /* If we are called from Console::uninit(), then try to destroy the VM even
    73217321     * on failure (this will most likely fail too, but what to do?..) */
    7322     if (RT_SUCCESS(vrc) || autoCaller.state() == InUninit)
     7322    if (RT_SUCCESS(vrc) || getObjectState().getState() == ObjectState::InUninit)
    73237323    {
    73247324        /* If the machine has a USB controller, release all USB devices
     
    75187518{
    75197519    /* sanity check */
    7520     AssertReturn(AutoCaller(this).state() == InInit ||
    7521                  isWriteLockOnCurrentThread(), E_FAIL);
     7520    AssertReturn(   getObjectState().getState() == ObjectState::InInit
     7521                 || isWriteLockOnCurrentThread(), E_FAIL);
    75227522
    75237523    LogFlowThisFunc(("Entering\n"));
     
    78637863     * 2) VM-(guest-)initiated power off. */
    78647864    AssertReturnVoid(   autoCaller.isOk()
    7865                      || autoCaller.state() == InUninit);
     7865                     || that->getObjectState().getState() == ObjectState::InUninit);
    78667866
    78677867    switch (enmState)
  • trunk/src/VBox/Main/src-client/SessionImpl.cpp

    r51612 r51903  
    475475    AutoCaller autoCaller(this);
    476476
    477     if (autoCaller.state() != Ready)
     477    if (getObjectState().getState() != ObjectState::Ready)
    478478    {
    479479        /*
     
    514514    HRESULT rc = S_OK;
    515515
    516     if (autoCaller.state() == Ready)
     516    if (getObjectState().getState() == ObjectState::Ready)
    517517    {
    518518        /* close() needs write lock */
     
    536536        rc = unlockMachine(false /* aFinalRelease */, true /* aFromServer */);
    537537    }
    538     else if (autoCaller.state() == InUninit)
     538    else if (getObjectState().getState() == ObjectState::InUninit)
    539539    {
    540540        /*
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