VirtualBox

Ignore:
Timestamp:
Jul 21, 2008 6:43:39 PM (17 years ago)
Author:
vboxsync
Message:

IPRT: Fixed an overlooked race found by the threaded testcase.

Location:
trunk/src/VBox/Runtime/common/misc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Runtime/common/misc/handletablectx.cpp

    r10789 r10790  
    159159            }
    160160
    161             /* insert the table we allocated */
    162             if (pThis->cCur < pThis->cMax)
    163             {
    164                 uint32_t iLevel1New = pThis->cCur / RTHT_LEVEL2_ENTRIES;
     161            /* insert the table we allocated. */
     162            uint32_t iLevel1New = pThis->cCur / RTHT_LEVEL2_ENTRIES;
     163            if (    iLevel1New < pThis->cLevel1
     164                &&  pThis->cCur < pThis->cMax)
     165            {
    165166                pThis->papvLevel1[iLevel1New] = paTable;
    166167
  • trunk/src/VBox/Runtime/common/misc/handletablesimple.cpp

    r10789 r10790  
    158158            }
    159159
    160             /* insert the table we allocated */
    161             if (pThis->cCur < pThis->cMax)
    162             {
    163                 uint32_t iLevel1New = pThis->cCur / RTHT_LEVEL2_ENTRIES;
     160            /* insert the table we allocated. */
     161            uint32_t iLevel1New = pThis->cCur / RTHT_LEVEL2_ENTRIES;
     162            if (    iLevel1New < pThis->cLevel1
     163                &&  pThis->cCur < pThis->cMax)
     164            {
    164165                pThis->papvLevel1[iLevel1New] = paTable;
    165166
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