VirtualBox

Changeset 31598 in vbox


Ignore:
Timestamp:
Aug 12, 2010 12:56:15 PM (14 years ago)
Author:
vboxsync
Message:

EventQueue: Don't return VERR_TIMEOUT if we processed a message in waitForEventsOnDarwin. return VINF_INTERRUPTED when encountering EINTR.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/EventQueue.h

    r31589 r31598  
    9292
    9393    BOOL postEvent(Event *event);
    94     int processEventQueue(uint32_t cMsTimeout);
     94    int processEventQueue(RTMSINTERVAL cMsTimeout);
    9595    int interruptEventQueueProcessing();
    9696    int getSelectFD();
  • trunk/src/VBox/Main/glue/EventQueue.cpp

    r31589 r31598  
    281281    CFTimeInterval rdTimeout = cMsTimeout == RT_INDEFINITE_WAIT ? 1e10 : (double)cMsTimeout / 1000;
    282282    OSStatus orc = CFRunLoopRunInMode(kCFRunLoopDefaultMode, rdTimeout, true /*returnAfterSourceHandled*/);
    283     /** @todo Not entire sure if the poll actually processes more than one message.
    284      *        Feel free to check the sources anyone.  */
    285283    if (orc == kCFRunLoopRunHandledSource)
    286         orc = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, false /*returnAfterSourceHandled*/);
     284    {
     285        OSStatus orc2 = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0.0, false /*returnAfterSourceHandled*/);
     286        if (   orc2 == kCFRunLoopRunStopped
     287            || orc2 == kCFRunLoopRunFinished)
     288            orc = orc2;
     289    }
    287290    if (    orc == 0
    288291        ||  orc == kCFRunLoopRunHandledSource)
     
    301304 * @retval  VINF_SUCCESS
    302305 * @retval  VERR_TIMEOUT
    303  * @retval  VERR_INTERRUPTED
     306 * @retval  VINF_INTERRUPTED
    304307 * @retval  VERR_INTERNAL_ERROR_4
    305308 *
     
    333336        rc = VERR_TIMEOUT;
    334337    else if (errno == EINTR)
    335         rc = VERR_INTERRUPTED;
     338        rc = VINF_INTERRUPTED;
    336339    else
    337340    {
     
    452455 * @retval  VERR_INTERRUPTED if interruptEventQueueProcessing was called.
    453456 *          On Windows will also be returned when WM_QUIT is encountered.
    454  *          On UNIXy systems this may also be returned when a signal is
    455  *          dispatched on the calling thread.
    456457 *          On Darwin this may also be returned when the native queue is
    457458 *          stopped or destroyed/finished.
    458  * @todo Change this method to use some status other than VERR_INTERRUPTED
    459  *       for indicating harmless interruptions by the system, or some other
    460  *       status for indicating interruptEventQueueProcessing/WM_QUIT.  Maybe
    461  *       VINF_INTERRUPTED for system interruption would be best appropriate.
     459 * @retval  VINF_INTERRUPTED if the native system call was interrupted by a
     460 *          an asynchronous event delivery (signal) or just felt like returning
     461 *          out of bounds.  On darwin it will also be returned if the queue is
     462 *          stopped.
    462463 */
    463464int EventQueue::processEventQueue(RTMSINTERVAL cMsTimeout)
     
    535536#endif // !VBOX_WITH_XPCOM
    536537
     538    Assert(rc != VERR_TIMEOUT || cMsTimeout != RT_INDEFINITE_WAIT);
    537539    return rc;
    538540}
  • trunk/src/VBox/Main/webservice/vboxweb.cpp

    r31597 r31598  
    771771
    772772    com::EventQueue *pQ = com::EventQueue::getMainEventQueue();
    773     while (1)
     773    for (;;)
    774774    {
    775775        // we have to process main event queue
    776776        WEBDEBUG(("Pumping COM event queue\n"));
    777777        int vrc = pQ->processEventQueue(RT_INDEFINITE_WAIT);
    778         if (RT_FAILURE(vrc) && vrc != VERR_TIMEOUT)
     778        if (RT_FAILURE(vrc))
    779779            RTMsgError("processEventQueue -> %Rrc", rc);
    780780    }
  • trunk/src/libs/xpcom18a4/java/src/nsJavaInterfaces.cpp

    r29153 r31598  
    372372
    373373    if (   rc == VERR_TIMEOUT
    374            || rc == VERR_INTERRUPTED)
     374        || rc == VERR_INTERRUPTED)
    375375        return 1;
    376376
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