VirtualBox

Changeset 31611 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 12, 2010 3:59:51 PM (14 years ago)
Author:
vboxsync
Message:

EventQueue.cpp: Fixed (/ worked around) another darwin issue when using a 0 ms timeout with processEventQueue.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/glue/EventQueue.cpp

    r31601 r31611  
    286286            orc = orc2;
    287287    }
    288     if (    orc == 0
    289         ||  orc == kCFRunLoopRunHandledSource)
     288    if (   orc == 0 /*???*/
     289        || orc == kCFRunLoopRunHandledSource)
    290290        return VINF_SUCCESS;
    291     if (    orc == kCFRunLoopRunStopped
    292         ||  orc == kCFRunLoopRunFinished)
     291    if (   orc == kCFRunLoopRunStopped
     292        || orc == kCFRunLoopRunFinished)
    293293        return VERR_INTERRUPTED;
    294294    AssertMsg(orc == kCFRunLoopRunTimedOut, ("Unexpected status code from CFRunLoopRunInMode: %#x", orc));
     
    419419 * Process pending XPCOM events.
    420420 * @param pQueue The queue to process events on.
    421  * @returns VINF_SUCCESS or VERR_TIMEOUT.
     421 * @retval  VINF_SUCCESS
     422 * @retval  VERR_TIMEOUT
     423 * @retval  VERR_INTERRUPTED (darwin only)
     424 * @retval  VERR_INTERNAL_ERROR_2
    422425 */
    423426static int processPendingEvents(nsIEventQueue *pQueue)
    424427{
    425     /* Check for timeout condition so the caller can be a bit more lazy. */
     428    /* ProcessPendingEvents doesn't report back what it did, so check here. */
    426429    PRBool fHasEvents = PR_FALSE;
    427430    nsresult hr = pQueue->PendingEvents(&fHasEvents);
    428431    if (NS_FAILED(hr))
    429432        return VERR_INTERNAL_ERROR_2;
    430     if (!fHasEvents)
    431         return VERR_TIMEOUT;
    432 
    433     pQueue->ProcessPendingEvents();
    434     return VINF_SUCCESS;
     433
     434    /* Process pending events. */
     435    int rc = VINF_SUCCESS;
     436    if (fHasEvents)
     437        pQueue->ProcessPendingEvents();
     438    else
     439        rc = VERR_TIMEOUT;
     440
     441# ifdef RT_OS_DARWIN
     442    /* Process pending native events. */
     443    int rc2 = waitForEventsOnDarwin(0);
     444    if (rc == VERR_TIMEOUT || rc2 == VERR_INTERRUPTED)
     445        rc = rc2;
     446# endif
     447
     448    return rc;
    435449}
    436450
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