VirtualBox

Changeset 40403 in vbox for trunk


Ignore:
Timestamp:
Mar 8, 2012 4:14:42 PM (13 years ago)
Author:
vboxsync
Message:

GuestCtrl: Don't try too hard when searching for a new context ID.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestCtrlImpl.cpp

    r40061 r40403  
    122122    /* Create a new context ID and assign it. */
    123123    uint32_t uNewContextID = 0;
     124    uint32_t uTries = 0;
    124125    for (;;)
    125126    {
     
    137138            break;
    138139        }
     140
     141        if (++uTries == UINT32_MAX)
     142            break; /* Don't try too hard. */
    139143    }
    140144
     
    191195}
    192196
     197/**
     198 * Checks whether a callback with the given context ID
     199 * exists or not.
     200 * Does not do locking!
     201 *
     202 * @return  bool                True, if callback exists, false if not.
     203 * @param   uContextID          Context ID to check.
     204 */
    193205bool Guest::callbackExists(uint32_t uContextID)
    194206{
    195207    AssertReturn(uContextID, false);
    196 
    197     AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);
    198208
    199209    CallbackMapIter it = mCallbackMap.find(uContextID);
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