VirtualBox

Changeset 83544 in vbox for trunk


Ignore:
Timestamp:
Apr 3, 2020 9:20:33 PM (5 years ago)
Author:
vboxsync
Message:

IPRT/poll.cpp: Rearranged code for better mojo when there are no handles in the set.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/r3/poll.cpp

    r82968 r83544  
    156156    int rc;
    157157
    158     if (RT_UNLIKELY(pThis->cHandles == 0 && cMillies == RT_INDEFINITE_WAIT))
    159         return VERR_DEADLOCK;
    160 
    161158    /*
    162159     * Check for special case, RTThreadSleep...
     
    165162    if (cHandles == 0)
    166163    {
    167         rc = RTThreadSleep(cMillies);
    168         if (RT_SUCCESS(rc))
    169             rc = VERR_TIMEOUT;
     164        if (RT_LIKELY(cMillies != RT_INDEFINITE_WAIT))
     165        {
     166            rc = RTThreadSleep(cMillies);
     167            if (RT_SUCCESS(rc))
     168                rc = VERR_TIMEOUT;
     169        }
     170        else
     171            rc = VERR_DEADLOCK;
    170172        return rc;
    171173    }
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