NativeEventQueue.cpp revision 6976ecae1d524fa439cc9aca14b612b262557cbe
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * MS COM / XPCOM Abstraction Layer:
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Main event queue class declaration
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Copyright (C) 2006-2010 Oracle Corporation
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * available from http://www.virtualbox.org. This file is free software;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * you can redistribute it and/or modify it under the terms of the GNU
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * General Public License (GPL) as published by the Free Software
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#if defined(VBOX_WITH_XPCOM) && !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync// NativeEventQueue class
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync////////////////////////////////////////////////////////////////////////////////
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync AssertMsg(GetCurrentThreadId() == mThreadId, ("Must be on event queue thread!")); \
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync } while (0)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Magic LPARAM value for the WM_USER messages that we're posting.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @remarks This magic value is duplicated in
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * vboxapi/PlatformMSCOM::interruptWaitEvents(). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#define EVENTQUEUE_WIN_LPARAM_MAGIC UINT32_C(0xf241b819)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync AssertMsg(isOnCurrentThread, ("Must be on event queue thread!")); \
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync } while (0)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/** Pointer to the main event queue. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncNativeEventQueue *NativeEventQueue::sMainQueue = NULL;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/* static */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncvoid *PR_CALLBACK com::NativeEventQueue::plEventHandler(PLEvent *self)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync NativeEventQueue *eq = (NativeEventQueue *)self->owner;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/* static */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncvoid PR_CALLBACK com::NativeEventQueue::plEventDestructor(PLEvent *self)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Constructs an event queue for the current thread.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Currently, there can be only one event queue per thread, so if an event
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * queue for the current thread already exists, this object is simply attached
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * to the existing event queue.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // force the system to create the message queue for the current thread
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_NOREMOVE);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync 0 /*dwDesiredAccess*/,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // Here we reference the global nsIEventQueueService instance and hold it
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // until we're destroyed. This is necessary to keep NS_ShutdownXPCOM() away
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // from calling StopAcceptingEvents() on all event queues upon destruction of
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // nsIEventQueueService, and makes sense when, for some reason, this happens
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // *before* we're able to send a NULL event to stop our event handler thread
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // when doing unexpected cleanup caused indirectly by NS_ShutdownXPCOM()
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // that is performing a global cleanup of everything. A good example of such
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // situation is when NS_ShutdownXPCOM() is called while the VirtualBox component
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // is still alive (because it is still referenced): eventually, it results in
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // a VirtualBox::uninit() call from where it is already not possible to post
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // NULL to the event thread (because it stopped accepting events).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync nsresult rc = NS_GetEventQueueService(getter_AddRefs(mEventQService));
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync rc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync rc = mEventQService->GetThreadEventQueue(NS_CURRENT_THREAD,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync // process all pending events before destruction
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Initializes the main event queue instance.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns VBox status code.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @remarks If you're using the rest of the COM/XPCOM glue library,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * com::Initialize() will take care of initializing and uninitializing
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * the NativeEventQueue class. If you don't call com::Initialize, you must
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * make sure to call this method on the same thread that did the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * XPCOM initialization or we'll end up using the wrong main queue.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/* static */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* Check that it actually is the main event queue, i.e. that
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync we're called on the right thread. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* Check that it's a native queue. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync rv = sMainQueue->mEventQ->IsQueueNative(&fIsNative);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Uninitialize the global resources (i.e. the main event queue instance).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns VINF_SUCCESS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/* static */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* Must process all events to make sure that no NULL event is left
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * after this point. It would need to modify the state of sMainQueue. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#ifdef RT_OS_DARWIN /* Do not process the native runloop, the toolkit may not be ready for it. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Get main event queue instance.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Depends on init() being called first.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/* static */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncNativeEventQueue* NativeEventQueue::getMainEventQueue()
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Wait for events and process them (Darwin).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VINF_SUCCESS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_TIMEOUT
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_INTERRUPTED
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param cMsTimeout How long to wait, or RT_INDEFINITE_WAIT.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncstatic int waitForEventsOnDarwin(RTMSINTERVAL cMsTimeout)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Wait for the requested time, if we get a hit we do a poll to process
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * any other pending messages.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Note! About 1.0e10: According to the sources anything above 3.1556952e+9
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * means indefinite wait and 1.0e10 is what CFRunLoopRun() uses.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync CFTimeInterval rdTimeout = cMsTimeout == RT_INDEFINITE_WAIT ? 1e10 : (double)cMsTimeout / 1000;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync OSStatus orc = CFRunLoopRunInMode(kCFRunLoopDefaultMode, rdTimeout, true /*returnAfterSourceHandled*/);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync OSStatus orc2 = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, false /*returnAfterSourceHandled*/);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync AssertMsg(orc == kCFRunLoopRunTimedOut, ("Unexpected status code from CFRunLoopRunInMode: %#x", orc));
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# else // !RT_OS_DARWIN
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Wait for events (generic XPCOM).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VINF_SUCCESS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_TIMEOUT
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VINF_INTERRUPTED
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_INTERNAL_ERROR_4
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pQueue The queue to wait on.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param cMsTimeout How long to wait, or RT_INDEFINITE_WAIT.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncstatic int waitForEventsOnXPCOM(nsIEventQueue *pQueue, RTMSINTERVAL cMsTimeout)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync int rc = select(fd + 1, &fdsetR, NULL, &fdsetE, ptv);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync else if (rc == 0)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync LogRel(("waitForEventsOnXPCOM rc=%d errno=%d\n", rc, errno));
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# endif // !RT_OS_DARWIN
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Dispatch a message on Windows.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This will pick out our events and handle them specially.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns @a rc or VERR_INTERRUPTED (WM_QUIT or NULL msg).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pMsg The message to dispatch.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param rc The current status code.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncint NativeEventQueue::dispatchMessageOnWindows(MSG const *pMsg, int rc)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Check for and dispatch our events.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync AssertMsgFailed(("lParam=%p wParam=%p\n", pMsg->lParam, pMsg->wParam));
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Check for the quit message and dispatch the message the normal way.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Process pending events (Windows).
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VINF_SUCCESS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_TIMEOUT
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_INTERRUPTED.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncstatic int processPendingEvents(void)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync if (PeekMessage(&Msg, NULL /*hWnd*/, 0 /*wMsgFilterMin*/, 0 /*wMsgFilterMax*/, PM_REMOVE))
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync rc = NativeEventQueue::dispatchMessageOnWindows(&Msg, rc);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync while (PeekMessage(&Msg, NULL /*hWnd*/, 0 /*wMsgFilterMin*/, 0 /*wMsgFilterMax*/, PM_REMOVE));
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Process pending XPCOM events.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param pQueue The queue to process events on.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VINF_SUCCESS
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_TIMEOUT
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_INTERRUPTED (darwin only)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_INTERNAL_ERROR_2
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncstatic int processPendingEvents(nsIEventQueue *pQueue)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* ProcessPendingEvents doesn't report back what it did, so check here. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* Process pending events. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* Process pending native events. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Process events pending on this event queue, and wait up to given timeout, if
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * nothing is available.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Must be called on same thread this event queue was created on.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param cMsTimeout The timeout specified as milliseconds. Use
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * RT_INDEFINITE_WAIT to wait till an event is posted on the
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns VBox status code
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VINF_SUCCESS if one or more messages was processed.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_TIMEOUT if cMsTimeout expired.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_INVALID_CONTEXT if called on the wrong thread.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VERR_INTERRUPTED if interruptEventQueueProcessing was called.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * On Windows will also be returned when WM_QUIT is encountered.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * On Darwin this may also be returned when the native queue is
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @retval VINF_INTERRUPTED if the native system call was interrupted by a
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * an asynchronous event delivery (signal) or just felt like returning
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * out of bounds. On darwin it will also be returned if the queue is
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncint NativeEventQueue::processEventQueue(RTMSINTERVAL cMsTimeout)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Process pending events, if none are available and we're not in a
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * poll call, wait for some to appear. (We have to be a little bit
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * careful after waiting for the events since Darwin will process
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * them as part of the wait, while the XPCOM case will not.)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Note! Unfortunately, WaitForEvent isn't interruptible with Ctrl-C,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * while select() is. So we cannot use it for indefinite waits.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /** @todo check how Ctrl-C works on Darwin. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# else // !RT_OS_DARWIN
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync# endif // !RT_OS_DARWIN
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else // !VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync && (fRet = GetMessage(&Msg, NULL /*hWnd*/, WM_USER, WM_USER))
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync rc = NativeEventQueue::dispatchMessageOnWindows(&Msg, rc);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync AssertMsgReturn(rcW == WAIT_TIMEOUT || rcW == WAIT_OBJECT_0,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // !VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync Assert(rc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Interrupt thread waiting on event queue processing.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Can be called on any thread.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @returns VBox status code.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncint NativeEventQueue::interruptEventQueueProcessing()
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* Send a NULL event. This event will be picked up and handled specially
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * both for XPCOM and Windows. It is the responsibility of the caller to
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * take care of not running the loop again in a way which will hang. */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Posts an event to this event loop asynchronously.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @param event the event to post, must be allocated using |new|
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * @return TRUE if successful and false otherwise
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsyncBOOL NativeEventQueue::postEvent(NativeEvent *pEvent)
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync /* Note! The event == NULL case is duplicated in vboxapi/PlatformMSCOM::interruptWaitEvents(). */
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync BOOL fRc = PostThreadMessage(mThreadId, WM_USER, (WPARAM)pEvent, EVENTQUEUE_WIN_LPARAM_MAGIC);
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync static int s_cBitchedAboutFullNativeEventQueue = 0;
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync LogRel(("Warning: Asynchronous event queue (%p, thread %RI32) full, event (%p) not delivered (%d/10)\n",
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync this, mThreadId, pEvent, ++s_cBitchedAboutFullNativeEventQueue));
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#else // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync mEventQ->InitEvent(pMyEvent, this, com::NativeEventQueue::plEventHandler,
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync AssertMsgFailed(("Out of memory while allocating memory for event=%p: %s\n",
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync#endif // VBOX_WITH_XPCOM
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * Get select()'able selector for this event queue.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * This will return -1 on platforms and queue variants not supporting such
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync * functionality.
0b74a2f80aba476dc8be8bc1c63891fc53945986vboxsync/* namespace com */