VirtualBox

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


Ignore:
Timestamp:
Nov 8, 2024 8:38:40 AM (2 months ago)
Author:
vboxsync
Message:

Added gTrackedObjectsCollector initialization and uninitialization.

File:
1 edited

Legend:

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

    r106061 r106881  
    6161
    6262LONG VirtualBoxClient::s_cUnnecessaryAtlModuleLocks = 0;
     63
     64extern TrackedObjectsCollector gTrackedObjectsCollector;
    6365
    6466#ifdef VBOX_WITH_MAIN_NLS
     
    203205            throw hrc;
    204206#endif
     207
     208        /////////////// Try to start Object tracker thread as earlier as possible ///////////////
     209        {
     210            int vrc = 0;
     211            if(gTrackedObjectsCollector.init())
     212            {
     213                try
     214                {
     215                    mData.m_objectTrackerTask = new ObjectTracker();
     216                    if (!mData.m_objectTrackerTask->init()) // some init procedure
     217                        vrc = E_FAIL;
     218                    else
     219                        vrc = mData.m_objectTrackerTask->createThread(); // mData->m_objectTrackerTask1 is not consumed
     220                }
     221                catch (...)
     222                {
     223                    LogRel(("Exception during starting the Object tracker thread\n"));
     224                    if (mData.m_objectTrackerTask)
     225                    {
     226                        delete mData.m_objectTrackerTask;
     227                        mData.m_objectTrackerTask = NULL;
     228                    }
     229                    vrc = E_FAIL;
     230                }
     231            }
     232
     233            if(RT_SUCCESS(vrc))
     234                LogRel(("Successfully started the Object tracker thread\n"));
     235            else
     236                LogRel(("Failed to start the Object tracker thread (%Rrc)\n", vrc));
     237        }
    205238
    206239        /* VirtualBox error return is postponed to method calls, fetch it. */
     
    594627    }
    595628
     629    if (mData.m_objectTrackerTask)
     630    {
     631        LogRel(("FRONTEND: Terminating the object tracker...\n"));
     632
     633        mData.m_objectTrackerTask->finish();//set the termination flag in the thread
     634        delete mData.m_objectTrackerTask;//waiting thread termination is going in the m_objectTrackerTask destructor
     635        gTrackedObjectsCollector.uninit();
     636    }
     637
    596638#ifdef VBOX_WITH_MAIN_NLS
    597639    i_unregisterEventListener();
     
    617659    }
    618660#endif
     661
    619662    mData.m_pToken.setNull();
    620663    mData.m_pVirtualBox.setNull();
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