VirtualBox

Changeset 50373 in vbox for trunk/src/VBox/Additions/x11


Ignore:
Timestamp:
Feb 9, 2014 4:12:28 PM (11 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
92128
Message:

Additions/x11/VBoxClient: seamless: take advantage of improved CANCEL_ALL_WAITEVENTS.

Location:
trunk/src/VBox/Additions/x11/VBoxClient
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/seamless.cpp

    r50346 r50373  
    6363        rc = VERR_INTERNAL_ERROR;
    6464        if (mHostEventThread)  /* Assertion */
     65            break;
     66        pszStage = "Testing event loop cancellation";
     67        VbglR3InterruptEventWaits();
     68        if (RT_FAILURE(VbglR3WaitEvent(VMMDEV_EVENT_VALID_EVENT_MASK, 0, NULL)))
     69            break;
     70        if (   VbglR3WaitEvent(VMMDEV_EVENT_VALID_EVENT_MASK, 0, NULL)
     71            != VERR_TIMEOUT)
    6572            break;
    6673        pszStage = "Connecting to the X server";
     
    221228
    222229    LogRelFlowFunc(("\n"));
    223     /**
    224      * @todo is this reasonable?  If the thread is in the event loop then the cancelEvent()
    225      *       will cause it to exit.  If it enters or exits the event loop it will also
    226      *       notice that we wish it to exit.  And if it is somewhere in-between, the
    227      *       yield() should give it time to get to one of places mentioned above.
    228      */
    229230    mHostEventThreadStopping = true;
    230     for (int i = 0; (i < 5) && mHostEventThreadRunning; ++i)
    231     {
    232         cancelEvent();
    233         RTThreadYield();
    234     }
     231    cancelEvent();
    235232    rc = RTThreadWait(mHostEventThread, RT_INDEFINITE_WAIT, NULL);
    236233    if (RT_SUCCESS(rc))
  • trunk/src/VBox/Additions/x11/VBoxClient/testcase/tstSeamlessX11.cpp

    r50346 r50373  
    6363    }
    6464    else
    65     {
    6665        rc = RTSemEventWait(eventSem, RT_INDEFINITE_WAIT);
    67         if (RT_SUCCESS(rc))
    68         {
    69             rc = VERR_INTERRUPTED;
    70         }
    71     }
    7266    return rc;
     67}
     68
     69int VbglR3WaitEvent(uint32_t , uint32_t cMillies, uint32_t *)
     70{
     71    return RTSemEventWait(eventSem, cMillies);
    7372}
    7473
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