VirtualBox

Changeset 85239 in vbox


Ignore:
Timestamp:
Jul 11, 2020 11:00:38 PM (4 years ago)
Author:
vboxsync
Message:

Main/EventImpl.cpp: Made VBoxEvent::waitProcessed and ListenerRecord::dequeue interpret all negative timeout values as meaning RT_INDEFINITE_WAIT like we do elsewhere in the API. Stumbled upon this due to a sign conversion issue highlighted by Clang 11. bugref:9790

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/EventImpl.cpp

    r82968 r85239  
    214214    alock.release();
    215215    /** @todo maybe while loop for spurious wakeups? */
    216     int vrc = ::RTSemEventWait(m->mWaitEvent, aTimeout);
     216    int vrc = ::RTSemEventWait(m->mWaitEvent, aTimeout < 0 ? RT_INDEFINITE_WAIT : (RTMSINTERVAL)aTimeout);
    217217    AssertMsg(RT_SUCCESS(vrc) || vrc == VERR_TIMEOUT || vrc == VERR_INTERRUPTED,
    218218              ("RTSemEventWait returned %Rrc\n", vrc));
     
    921921            aAlock.release();
    922922
    923             ::RTSemEventWait(hEvt, aTimeout);
     923            ::RTSemEventWait(hEvt, aTimeout < 0 ? RT_INDEFINITE_WAIT : (RTMSINTERVAL)aTimeout);
    924924            ASMAtomicDecS32(&mQEventBusyCnt);
    925925
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