VirtualBox

vbox的更動 61714 路徑 trunk/src/VBox/Main


忽略:
時間撮記:
2016-6-15 下午01:16:38 (8 年 以前)
作者:
vboxsync
訊息:

Main/xpcom/server.cpp: change the behavior of the SIGUSR1 signal handling: now it gracefully terminates an idle VBoxSVC even if it's not started with the autoterminate flag

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Main/src-server/xpcom/server.cpp

    r61196 r61714  
    55
    66/*
    7  * Copyright (C) 2004-2015 Oracle Corporation
     7 * Copyright (C) 2004-2016 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    211211    class MaybeQuitEvent : public NativeEvent
    212212    {
     213    public:
     214        MaybeQuitEvent() :
     215            m_fSignal(false)
     216        {
     217        }
     218
     219        MaybeQuitEvent(bool fSignal) :
     220            m_fSignal(fSignal)
     221        {
     222        }
     223
     224    private:
    213225        /* called on the main thread */
    214226        void *handler()
     
    234246            if (count == 0)
    235247            {
    236                 if (gAutoShutdown)
     248                if (gAutoShutdown || m_fSignal)
    237249                {
    238250                    Assert(sInstance == NULL);
     
    257269            return NULL;
    258270        }
     271
     272        bool m_fSignal;
    259273    };
    260274
     
    272286
    273287        /* post a quit event to the main queue */
    274         MaybeQuitEvent *ev = new MaybeQuitEvent();
     288        MaybeQuitEvent *ev = new MaybeQuitEvent(false /* fSignal */);
    275289        if (!q->postEvent(ev))
    276290            delete ev;
     
    516530            if (gAllowSigUsrQuit)
    517531            {
    518                 VirtualBoxClassFactory::MaybeQuitEvent *ev = new VirtualBoxClassFactory::MaybeQuitEvent();
     532                /* terminate the server process if it is idle */
     533                VirtualBoxClassFactory::MaybeQuitEvent *ev = new VirtualBoxClassFactory::MaybeQuitEvent(true /* fSignal */);
    519534                if (!q->postEvent(ev))
    520535                    delete ev;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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