VirtualBox

Ignore:
Timestamp:
Sep 10, 2009 12:02:36 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52173
Message:

event queues cleaned up

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp

    r22686 r22911  
    18251825    }
    18261826
    1827     /* create the event queue
    1828      * (here it is necessary only to process remaining XPCOM/IPC events
    1829      * after the session is closed) */
    1830 
    1831 #ifdef VBOX_WITH_XPCOM
    1832     nsCOMPtr<nsIEventQueue> eventQ;
    1833     NS_GetMainEventQ(getter_AddRefs(eventQ));
    1834 #endif
    1835 
    1836 #ifdef VBOX_WITH_XPCOM
    1837     HandlerArg handlerArg = { 0, NULL, eventQ, virtualBox, session };
    1838 #else
    18391827    HandlerArg handlerArg = { 0, NULL, virtualBox, session };
    1840 #endif
    18411828
    18421829    /*
     
    19171904    session->Close();
    19181905
    1919 #ifdef VBOX_WITH_XPCOM
    1920     eventQ->ProcessPendingEvents();
    1921 #endif
    1922 
     1906    EventQueue::getMainEventQueue()->processEventQueue(0);
    19231907    // end "all-stuff" scope
    19241908    ////////////////////////////////////////////////////////////////////////////
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r22686 r22911  
    2727#include <VBox/com/ptr.h>
    2828#include <VBox/com/VirtualBox.h>
    29 #include <VBox/com/EventQueue.h>
    3029#include <VBox/com/string.h>
    3130#endif /* !VBOX_ONLY_DOCS */
    3231
    3332#include <iprt/types.h>
    34 
    35 #if defined(VBOX_WITH_XPCOM) && !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2)
    36 # define USE_XPCOM_QUEUE
    37 #endif
    3833
    3934////////////////////////////////////////////////////////////////////////////////
     
    108103    char **argv;
    109104
    110 #ifdef VBOX_WITH_XPCOM
    111     nsCOMPtr<nsIEventQueue> eventQ;
    112 #endif
    113105#ifndef VBOX_ONLY_DOCS
    114106    ComPtr<IVirtualBox> virtualBox;
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp

    r22811 r22911  
    3333
    3434#include <VBox/com/VirtualBox.h>
     35#include <VBox/com/EventQueue.h>
    3536
    3637#include <VBox/log.h>
     
    393394
    394395/**
    395  * Callback for processThreadEventQueue.
    396  *
    397  * @param   pvUser  Pointer to the callback object.
    398  *
    399  * @returns true if it should return or false if it should continue waiting for
    400  *          events.
    401  */
    402 static bool eventExitCheck(void *pvUser)
    403 {
    404     GuestPropertyCallback const *pCallbacks = (GuestPropertyCallback const *)pvUser;
    405     return pCallbacks->Signalled();
    406 }
    407 
    408 /**
    409396 * Enumerates the properties in the guest property store.
    410397 *
     
    473460    a->virtualBox->RegisterCallback(callback);
    474461
    475     int vrc = com::EventQueue::processThreadEventQueue(cMsTimeout, eventExitCheck, (void *)cbImpl,
    476                                                        1000 /*cMsPollInterval*/, false /*fReturnOnEvent*/);
    477     if (   RT_FAILURE(vrc)
    478         && vrc != VERR_CALLBACK_RETURN
    479         && vrc != VERR_TIMEOUT)
    480     {
    481         RTPrintf("Error waiting for event: %Rrc\n", vrc);
    482         return 1;
    483     }
     462    do {
     463      int vrc = com::EventQueue::getMainEventQueue()->processEventQueue(1000);
     464      if (RT_FAILURE(vrc) && vrc != VERR_TIMEOUT)
     465      {
     466          RTPrintf("Error waiting for event: %Rrc\n", vrc);
     467          return 1;
     468      }
     469    } while  (!cbImpl->Signalled());
    484470
    485471    a->virtualBox->UnregisterCallback(callback);
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