VirtualBox

Changeset 50372 in vbox for trunk/src


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

Additions/common/VBoxGuest: make CANCEL_ALL_WAITEVENTS cancel the next WAITEVENT if none is in progress.

Location:
trunk/src/VBox/Additions/common/VBoxGuest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest.cpp

    r49950 r50372  
    13731373{
    13741374    uint32_t fMatches = VBoxGuestCommonGetAndCleanPendingEventsLocked(pDevExt, pSession, fReqEvents);
    1375     if (fMatches)
     1375    if (fMatches || pSession->fPendingCancelWaitEvents)
    13761376    {
    13771377        RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
     
    13831383        else
    13841384            Log(("VBoxGuestCommonIOCtl: WAITEVENT: returns %#x/%d\n", pInfo->u32EventFlagsOut, iEvent));
     1385        pSession->fPendingCancelWaitEvents = false;
    13851386        return VINF_SUCCESS;
    13861387    }
     
    15191520    PVBOXGUESTWAIT          pSafe;
    15201521    int                     rc = 0;
     1522    /* Was as least one WAITEVENT in process for this session?  If not we
     1523     * set a flag that the next call should be interrupted immediately.  This
     1524     * is needed so that a user thread can reliably interrupt another one in a
     1525     * WAITEVENT loop. */
     1526    bool                    fCancelledOne = false;
    15211527
    15221528    Log(("VBoxGuestCommonIOCtl: CANCEL_ALL_WAITEVENTS\n"));
     
    15301536        if (pWait->pSession == pSession)
    15311537        {
     1538            fCancelledOne = true;
    15321539            pWait->fResEvents = UINT32_MAX;
    15331540            RTListNodeRemove(&pWait->ListNode);
     
    15401547        }
    15411548    }
     1549    if (!fCancelledOne)
     1550        pSession->fPendingCancelWaitEvents = true;
    15421551    RTSpinlockReleaseNoInts(pDevExt->EventSpinlock);
    15431552    Assert(rc == 0);
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuestInternal.h

    r45779 r50372  
    237237    /* Guest Caps Acquired & Reported by this session */
    238238    uint32_t                    u32AquiredGuestCaps;
     239    /** Whether a CANCEL_ALL_WAITEVENTS is pending.  This happens when
     240     * CANCEL_ALL_WAITEVENTS is called, but no call to WAITEVENT is in process
     241     * in the current session.  In that case the next call will be interrupted
     242     * at once. */
     243    bool volatile               fPendingCancelWaitEvents;
    239244} VBOXGUESTSESSION;
    240245
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