VirtualBox

Changeset 43228 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Sep 6, 2012 3:28:12 PM (12 years ago)
Author:
vboxsync
Message:

PDMNetShaper.cpp: style, shorten thread name.

File:
1 edited

Legend:

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

    r42064 r43228  
    11/* $Id$ */
    22/** @file
    3  * PDM Network Shaper - Limit network traffic according to bandwidth
    4  * group settings.
     3 * PDM Network Shaper - Limit network traffic according to bandwidth group settings.
    54 */
    65
     
    6766
    6867
    69 /*******************************************************************************
    70 *   Internal Functions                                                         *
    71 *******************************************************************************/
     68
     69
    7270
    7371static PPDMNSBWGROUP pdmNsBwGroupFindById(PPDMNETSHAPER pShaper, const char *pcszId)
     
    9088}
    9189
     90
    9291static void pdmNsBwGroupLink(PPDMNSBWGROUP pBwGroup)
    9392{
     
    10099    rc = RTCritSectLeave(&pShaper->cs); AssertRC(rc);
    101100}
     101
    102102
    103103#if 0
     
    123123}
    124124#endif
     125
    125126
    126127static void pdmNsBwGroupSetLimit(PPDMNSBWGROUP pBwGroup, uint64_t cbTransferPerSecMax)
     
    132133                 pBwGroup->cbTransferPerSecMax, pBwGroup->cbBucketSize));
    133134}
     135
    134136
    135137static int pdmNsBwGroupCreate(PPDMNETSHAPER pShaper, const char *pcszBwGroup, uint64_t cbTransferPerSecMax)
     
    160162
    161163                    pdmNsBwGroupSetLimit(pBwGroup, cbTransferPerSecMax);
    162 ;
     164
    163165                    pBwGroup->cbTokensLast          = pBwGroup->cbBucketSize;
    164166                    pBwGroup->tsUpdatedLast         = RTTimeSystemNanoTS();
     
    183185}
    184186
     187
    185188static void pdmNsBwGroupTerminate(PPDMNSBWGROUP pBwGroup)
    186189{
     
    196199}
    197200
     201
    198202DECLINLINE(void) pdmNsBwGroupUnref(PPDMNSBWGROUP pBwGroup)
    199203{
     
    201205    ASMAtomicDecU32(&pBwGroup->cRefs);
    202206}
     207
    203208
    204209static void pdmNsBwGroupXmitPending(PPDMNSBWGROUP pBwGroup)
     
    235240}
    236241
     242
    237243static void pdmNsFilterLink(PPDMNSFILTER pFilter)
    238244{
     
    245251    rc = PDMCritSectLeave(&pBwGroup->cs); AssertRC(rc);
    246252}
     253
    247254
    248255static void pdmNsFilterUnlink(PPDMNSFILTER pFilter)
     
    275282}
    276283
     284
    277285VMMR3DECL(int) PDMR3NsAttach(PVM pVM, PPDMDRVINS pDrvIns, const char *pcszBwGroup,
    278286                             PPDMNSFILTER pFilter)
     
    314322    return rc;
    315323}
     324
    316325
    317326VMMR3DECL(int) PDMR3NsDetach(PVM pVM, PPDMDRVINS pDrvIns, PPDMNSFILTER pFilter)
     
    337346}
    338347
     348
    339349VMMR3DECL(bool) PDMR3NsAllocateBandwidth(PPDMNSFILTER pFilter, size_t cbTransfer)
    340350{
    341351    return pdmNsAllocateBandwidth(pFilter, cbTransfer);
    342352}
     353
    343354
    344355VMMR3DECL(int) PDMR3NsBwGroupSetLimit(PVM pVM, const char *pcszBwGroup, uint64_t cbTransferPerSecMax)
     
    393404}
    394405
     406
    395407/**
    396408 * @copydoc FNPDMTHREADWAKEUPINT
     
    403415    return VINF_SUCCESS;
    404416}
     417
    405418
    406419/**
     
    433446}
    434447
     448
    435449/**
    436450 * Initialize the network shaper.
     
    494508            {
    495509                PUVM pUVM = pVM->pUVM;
    496                 AssertMsg(!pUVM->pdm.s.pNetShaper,
    497                           ("Network shaper was already initialized\n"));
    498 
    499                 char szDesc[256];
    500                 static unsigned iThread;
    501 
    502                 RTStrPrintf(szDesc, sizeof(szDesc), "PDMNSTXThread-%d", ++iThread);
     510                AssertMsg(!pUVM->pdm.s.pNetShaper, ("Network shaper was already initialized\n"));
     511
     512                char szDesc[64];
     513                static unsigned s_iThread;
     514
     515                RTStrPrintf(szDesc, sizeof(szDesc), "PDMNsTx-%d", ++s_iThread);
    503516                rc = PDMR3ThreadCreate(pVM, &pNetShaper->hTxThread, pNetShaper,
    504517                                       pdmR3NsTxThread, pdmR3NsTxWakeUp, 0,
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