VirtualBox

Changeset 41864 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Jun 21, 2012 5:21:12 PM (12 years ago)
Author:
vboxsync
Message:

PCNet,NetShaper: PCNet exact packet len counting + wrong lock order fix in NetShaper (#5582)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMR3/PDMNetShaper.cpp

    r41783 r41864  
    233233static void pdmNsBwGroupXmitPending(PPDMNSBWGROUP pBwGroup)
    234234{
    235     int rc = RTCritSectEnter(&pBwGroup->cs); AssertRC(rc);
     235    /*
     236     * We don't need to hold the bandwidth group lock to iterate over the list
     237     * of filters since the filters are removed while the shaper lock is being
     238     * held.
     239     */
     240    AssertPtr(pBwGroup);
     241    AssertPtr(pBwGroup->pShaper);
     242    Assert(RTCritSectIsOwner(&pBwGroup->pShaper->cs));
     243    //int rc = RTCritSectEnter(&pBwGroup->cs); AssertRC(rc);
    236244
    237245    PPDMNSFILTER pFilter = pBwGroup->pFiltersHead;
     
    249257    }
    250258
    251     rc = RTCritSectLeave(&pBwGroup->cs); AssertRC(rc);
     259    //rc = RTCritSectLeave(&pBwGroup->cs); AssertRC(rc);
    252260}
    253261
     
    266274{
    267275    PPDMNSBWGROUP pBwGroup = pFilter->pBwGroupR3;
     276    /*
     277     * We need to make sure we hold the shaper lock since pdmNsBwGroupXmitPending()
     278     * does not hold the bandwidth group lock while iterating over the list
     279     * of group's filters.
     280     */
     281    AssertPtr(pBwGroup);
     282    AssertPtr(pBwGroup->pShaper);
     283    Assert(RTCritSectIsOwner(&pBwGroup->pShaper->cs));
    268284    int rc = RTCritSectEnter(&pBwGroup->cs); AssertRC(rc);
    269285
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