Changeset 22911 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Sep 10, 2009 12:02:36 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 52173
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r22686 r22911 1825 1825 } 1826 1826 1827 /* create the event queue1828 * (here it is necessary only to process remaining XPCOM/IPC events1829 * after the session is closed) */1830 1831 #ifdef VBOX_WITH_XPCOM1832 nsCOMPtr<nsIEventQueue> eventQ;1833 NS_GetMainEventQ(getter_AddRefs(eventQ));1834 #endif1835 1836 #ifdef VBOX_WITH_XPCOM1837 HandlerArg handlerArg = { 0, NULL, eventQ, virtualBox, session };1838 #else1839 1827 HandlerArg handlerArg = { 0, NULL, virtualBox, session }; 1840 #endif1841 1828 1842 1829 /* … … 1917 1904 session->Close(); 1918 1905 1919 #ifdef VBOX_WITH_XPCOM 1920 eventQ->ProcessPendingEvents(); 1921 #endif 1922 1906 EventQueue::getMainEventQueue()->processEventQueue(0); 1923 1907 // end "all-stuff" scope 1924 1908 //////////////////////////////////////////////////////////////////////////// -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r22686 r22911 27 27 #include <VBox/com/ptr.h> 28 28 #include <VBox/com/VirtualBox.h> 29 #include <VBox/com/EventQueue.h>30 29 #include <VBox/com/string.h> 31 30 #endif /* !VBOX_ONLY_DOCS */ 32 31 33 32 #include <iprt/types.h> 34 35 #if defined(VBOX_WITH_XPCOM) && !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2)36 # define USE_XPCOM_QUEUE37 #endif38 33 39 34 //////////////////////////////////////////////////////////////////////////////// … … 108 103 char **argv; 109 104 110 #ifdef VBOX_WITH_XPCOM111 nsCOMPtr<nsIEventQueue> eventQ;112 #endif113 105 #ifndef VBOX_ONLY_DOCS 114 106 ComPtr<IVirtualBox> virtualBox; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageGuestProp.cpp
r22811 r22911 33 33 34 34 #include <VBox/com/VirtualBox.h> 35 #include <VBox/com/EventQueue.h> 35 36 36 37 #include <VBox/log.h> … … 393 394 394 395 /** 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 for400 * events.401 */402 static bool eventExitCheck(void *pvUser)403 {404 GuestPropertyCallback const *pCallbacks = (GuestPropertyCallback const *)pvUser;405 return pCallbacks->Signalled();406 }407 408 /**409 396 * Enumerates the properties in the guest property store. 410 397 * … … 473 460 a->virtualBox->RegisterCallback(callback); 474 461 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()); 484 470 485 471 a->virtualBox->UnregisterCallback(callback);
Note:
See TracChangeset
for help on using the changeset viewer.