VirtualBox

Changeset 13696 in vbox


Ignore:
Timestamp:
Oct 30, 2008 9:58:59 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
38661
Message:

Main: Fixed: Closing sessions was not always noticed by the server which caused a hang during poweroff (regression after adding spawning session watchdog).

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

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

    r13638 r13696  
    38343834#if defined (RT_OS_WINDOWS)
    38353835bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    3836                              HANDLE *aIPCSem /*= NULL*/)
     3836                             HANDLE *aIPCSem /*= NULL*/,
     3837                             bool aAllowClosing /*= false*/)
    38373838#elif defined (RT_OS_OS2)
    38383839bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    3839                              HMTX *aIPCSem /*= NULL*/);
     3840                             HMTX *aIPCSem /*= NULL*/,
     3841                             bool aAllowClosing /*= false*/);
    38403842#else
    3841 bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine)
     3843bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
     3844                             bool aAllowClosing /*= false*/)
    38423845#endif
    38433846{
     
    38513854    AutoReadLock alock (this);
    38523855
    3853     if (mData->mSession.mState == SessionState_Open)
     3856    if (mData->mSession.mState == SessionState_Open ||
     3857        (aAllowClosing && mData->mSession.mState == SessionState_Closing))
    38543858    {
    38553859        AssertReturn (!mData->mSession.mMachine.isNull(), false);
  • trunk/src/VBox/Main/VirtualBoxImpl.cpp

    r13580 r13696  
    40714071                    ComObjPtr <SessionMachine> sm;
    40724072                    HANDLE ipcSem;
    4073                     if ((*it)->isSessionOpen (sm, &ipcSem))
     4073                    if ((*it)->isSessionOpenOrClosing (sm, &ipcSem))
    40744074                    {
    40754075                        machines.push_back (sm);
     
    42634263                        ComObjPtr <SessionMachine> sm;
    42644264                        HMTX ipcSem;
    4265                         if ((*it)->isSessionOpen (sm, &ipcSem))
     4265                        if ((*it)->isSessionOpenOrClosing (sm, &ipcSem))
    42664266                        {
    42674267                            machines.push_back (sm);
     
    43564356                    {
    43574357                        ComObjPtr <SessionMachine> sm;
    4358                         if ((*it)->isSessionOpen (sm))
     4358                        if ((*it)->isSessionOpenOrClosing (sm))
    43594359                            machines.push_back (sm);
    43604360                    }
  • trunk/src/VBox/Main/include/MachineImpl.h

    r13580 r13696  
    634634
    635635#if defined (RT_OS_WINDOWS)
     636
    636637    bool isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    637                         HANDLE *aIPCSem = NULL);
     638                        HANDLE *aIPCSem = NULL, bool aAllowClosing = false);
    638639    bool isSessionSpawning (RTPROCESS *aPID = NULL);
     640
     641    bool isSessionOpenOrClosing (ComObjPtr <SessionMachine> &aMachine,
     642                                 HANDLE *aIPCSem = NULL)
     643    { return isSessionOpen (aMachine, aIPCSem, true /* aAllowClosing */); }
     644
    639645#elif defined (RT_OS_OS2)
     646
    640647    bool isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    641                         HMTX *aIPCSem = NULL);
     648                        HMTX *aIPCSem = NULL, bool aAllowClosing = false);
     649
    642650    bool isSessionSpawning (RTPROCESS *aPID = NULL);
     651
     652    bool isSessionOpenOrClosing (ComObjPtr <SessionMachine> &aMachine,
     653                                 HMTX *aIPCSem = NULL)
     654    { return isSessionOpen (aMachine, aIPCSem, true /* aAllowClosing */); }
     655
    643656#else
    644     bool isSessionOpen (ComObjPtr <SessionMachine> &aMachine);
     657
     658    bool isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
     659                        bool aAllowClosing = false);
    645660    bool isSessionSpawning();
     661
     662    bool isSessionOpenOrClosing (ComObjPtr <SessionMachine> &aMachine)
     663    { return isSessionOpen (aMachine, true /* aAllowClosing */); }
     664
    646665#endif
    647666
     
    942961    Bstr mIPCSemName;
    943962    friend bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    944                                         HANDLE *aIPCSem);
     963                                        HANDLE *aIPCSem, bool aAllowClosing);
    945964#elif defined (RT_OS_OS2)
    946965    HMTX mIPCSem;
    947966    Bstr mIPCSemName;
    948967    friend bool Machine::isSessionOpen (ComObjPtr <SessionMachine> &aMachine,
    949                                         HMTX *aIPCSem);
     968                                        HMTX *aIPCSem, bool aAllowClosing);
    950969#elif defined (VBOX_WITH_SYS_V_IPC_SESSION_WATCHER)
    951970    int mIPCSem;
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