VirtualBox

Changeset 28438 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Apr 17, 2010 9:58:52 PM (15 years ago)
Author:
vboxsync
Message:

renamed a semaphore to make it easier to work with... but got distracted so got no work done.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r28430 r28438  
    55
    66/*
    7  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     7 * Copyright (C) 2006-2010 Sun Microsystems, Inc.
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    359359     *        another mutex for creation / destruction serilization. */
    360360#endif
    361     RTSEMFASTMUTEX          FastMutex;
     361    RTSEMFASTMUTEX          FastMutex2;
    362362#ifdef WITH_NEW_STUFF
    363363    /** Wait for an interface to stop being busy so it can be removed or have its
     
    20202020        ||  intnetR0TrunkIfRetain(pThis))
    20212021    {
    2022         rc = RTSemFastMutexRelease(pNetwork->FastMutex);
     2022        rc = RTSemFastMutexRelease(pNetwork->FastMutex2);
    20232023        AssertRC(rc);
    20242024        if (RT_SUCCESS(rc))
     
    20422042            }
    20432043
    2044             int rc2 = RTSemFastMutexRequest(pNetwork->FastMutex);
     2044            int rc2 = RTSemFastMutexRequest(pNetwork->FastMutex2);
    20452045            AssertRC(rc2);
    20462046        }
     
    26362636     */
    26372637    PINTNETNETWORK pNetwork = pIf->pNetwork;
    2638     int rc = RTSemFastMutexRequest(pNetwork->FastMutex);
     2638    int rc = RTSemFastMutexRequest(pNetwork->FastMutex2);
    26392639    if (RT_FAILURE(rc))
    26402640    {
     
    26452645    if (pTrunkIf)
    26462646    {
    2647         RTSemFastMutexRelease(pIf->pNetwork->FastMutex);
     2647        RTSemFastMutexRelease(pIf->pNetwork->FastMutex2);
    26482648
    26492649        if (!intnetR0TrunkIfOutLock(pTrunkIf))
     
    26542654        }
    26552655
    2656         rc = RTSemFastMutexRequest(pNetwork->FastMutex);
     2656        rc = RTSemFastMutexRequest(pNetwork->FastMutex2);
    26572657        if (RT_FAILURE(rc))
    26582658        {
     
    27112711     * Release the semaphore(s) and release references.
    27122712     */
    2713     rc = RTSemFastMutexRelease(pNetwork->FastMutex);
     2713    rc = RTSemFastMutexRelease(pNetwork->FastMutex2);
    27142714    if (pTrunkIf)
    27152715    {
     
    27672767     * allocating the buffer.
    27682768     */
    2769     int rc = RTSemFastMutexRequest(pIf->pNetwork->FastMutex);
     2769    int rc = RTSemFastMutexRequest(pIf->pNetwork->FastMutex2);
    27702770    if (RT_SUCCESS(rc))
    27712771    {
    27722772        *ppRing3Buf = pIf->pIntBufR3;
    2773         rc = RTSemFastMutexRelease(pIf->pNetwork->FastMutex);
     2773        rc = RTSemFastMutexRelease(pIf->pNetwork->FastMutex2);
    27742774    }
    27752775
     
    28232823     * ASSUMES that the handle isn't closed while we're here.
    28242824     */
    2825     int rc = RTSemFastMutexRequest(pIf->pNetwork->FastMutex);
     2825    int rc = RTSemFastMutexRequest(pIf->pNetwork->FastMutex2);
    28262826    if (RT_SUCCESS(rc))
    28272827    {
    28282828        *ppRing0Buf = pIf->pIntBuf;
    28292829
    2830         rc = RTSemFastMutexRelease(pIf->pNetwork->FastMutex);
     2830        rc = RTSemFastMutexRelease(pIf->pNetwork->FastMutex2);
    28312831    }
    28322832    intnetR0IfRelease(pIf, pSession);
     
    29072907    if (pNetwork)
    29082908    {
    2909         rc = RTSemFastMutexRequest(pNetwork->FastMutex);
     2909        rc = RTSemFastMutexRequest(pNetwork->FastMutex2);
    29102910        if (RT_SUCCESS(rc))
    29112911        {
     
    29172917            }
    29182918
    2919             rc = RTSemFastMutexRelease(pNetwork->FastMutex);
     2919            rc = RTSemFastMutexRelease(pNetwork->FastMutex2);
    29202920        }
    29212921    }
     
    29762976    if (pNetwork)
    29772977    {
    2978         rc = RTSemFastMutexRequest(pNetwork->FastMutex);
     2978        rc = RTSemFastMutexRequest(pNetwork->FastMutex2);
    29792979        if (RT_SUCCESS(rc))
    29802980        {
     
    29872987            }
    29882988
    2989             rc = RTSemFastMutexRelease(pNetwork->FastMutex);
     2989            rc = RTSemFastMutexRelease(pNetwork->FastMutex2);
    29902990        }
    29912991    }
     
    30403040        return VERR_SEM_DESTROYED;
    30413041
    3042     int rc = RTSemFastMutexRequest(pNetwork->FastMutex); AssertRC(rc);
     3042    int rc = RTSemFastMutexRequest(pNetwork->FastMutex2); AssertRC(rc);
    30433043    if (RT_SUCCESS(rc))
    30443044    {
     
    30643064                 * the network semaphore so we don't create any deadlocks.
    30653065                 */
    3066                 int rc2 = RTSemFastMutexRelease(pNetwork->FastMutex); AssertRC(rc2);
     3066                int rc2 = RTSemFastMutexRelease(pNetwork->FastMutex2); AssertRC(rc2);
    30673067                fNetworkLocked = false;
    30683068
     
    30733073
    30743074        if (fNetworkLocked)
    3075             RTSemFastMutexRelease(pNetwork->FastMutex);
     3075            RTSemFastMutexRelease(pNetwork->FastMutex2);
    30763076    }
    30773077    if (pTrunkIf)
     
    34183418    {
    34193419        SUPR0MemFree(pIf->pSession, (RTHCUINTPTR)pIf->pIntBufDefault);
    3420         pIf->pIntBufDefault = NULL;
    3421         pIf->pIntBufDefaultR3 = 0;
    3422         pIf->pIntBuf = NULL;
    3423         pIf->pIntBufR3 = 0;
     3420        pIf->pIntBufDefault     = NULL;
     3421        pIf->pIntBufDefaultR3   = 0;
     3422        pIf->pIntBuf            = NULL;
     3423        pIf->pIntBufR3          = 0;
    34243424    }
    34253425
     
    35213521             * Link the interface to the network.
    35223522             */
    3523             rc = RTSemFastMutexRequest(pNetwork->FastMutex);
     3523            rc = RTSemFastMutexRequest(pNetwork->FastMutex2);
    35243524            if (RT_SUCCESS(rc))
    35253525            {
    35263526                pIf->pNext = pNetwork->pIFs;
    35273527                pNetwork->pIFs = pIf;
    3528                 RTSemFastMutexRelease(pNetwork->FastMutex);
     3528                RTSemFastMutexRelease(pNetwork->FastMutex2);
    35293529
    35303530                /*
     
    35483548                }
    35493549
    3550                 RTSemFastMutexDestroy(pNetwork->FastMutex);
    3551                 pNetwork->FastMutex = NIL_RTSEMFASTMUTEX;
     3550                RTSemFastMutexDestroy(pNetwork->FastMutex2);
     3551                pNetwork->FastMutex2 = NIL_RTSEMFASTMUTEX;
    35523552            }
    35533553
     
    36043604    /* assert some sanity */
    36053605    AssertPtrReturn(pNetwork, INTNETSWDECISION_TRUNK);
    3606     AssertReturn(pNetwork->FastMutex != NIL_RTSEMFASTMUTEX, INTNETSWDECISION_TRUNK);
     3606    AssertReturn(pNetwork->FastMutex2 != NIL_RTSEMFASTMUTEX, INTNETSWDECISION_TRUNK);
    36073607    AssertPtr(pvSrc);
    36083608    AssertPtr(cbSrc >= 6);
     
    36233623    /* assert some sanity */
    36243624    AssertPtrReturn(pNetwork, false);
    3625     AssertReturn(pNetwork->FastMutex != NIL_RTSEMFASTMUTEX, false);
     3625    AssertReturn(pNetwork->FastMutex2 != NIL_RTSEMFASTMUTEX, false);
    36263626    AssertPtr(pSG);
    36273627    Assert(fSrc);
     
    36303630     * Lock the network and send the frame to it.
    36313631     */
    3632     int rc = RTSemFastMutexRequest(pNetwork->FastMutex);
     3632    int rc = RTSemFastMutexRequest(pNetwork->FastMutex2);
    36333633    AssertRCReturn(rc, false);
    36343634
     
    36393639        fRc = false; /* don't drop it */
    36403640
    3641     rc = RTSemFastMutexRelease(pNetwork->FastMutex);
     3641    rc = RTSemFastMutexRelease(pNetwork->FastMutex2);
    36423642    AssertRC(rc);
    36433643
     
    36543654    /* assert some sanity */
    36553655    AssertPtrReturnVoid(pNetwork);
    3656     AssertReturnVoid(pNetwork->FastMutex != NIL_RTSEMFASTMUTEX);
     3656    AssertReturnVoid(pNetwork->FastMutex2 != NIL_RTSEMFASTMUTEX);
    36573657    AssertPtr(pSG);
    36583658    Assert(pSG->cUsers > 0 && pSG->cUsers < 256);
     
    36713671    /* assert some sanity */
    36723672    AssertPtrReturnVoid(pNetwork);
    3673     AssertReturnVoid(pNetwork->FastMutex != NIL_RTSEMFASTMUTEX);
     3673    AssertReturnVoid(pNetwork->FastMutex2 != NIL_RTSEMFASTMUTEX);
    36743674    AssertPtr(pSG);
    36753675    Assert(pSG->cUsers > 0);
     
    40184018     * deal with this by simply orphaning the interfaces.
    40194019     */
    4020     RTSemFastMutexRequest(pNetwork->FastMutex);
     4020    RTSemFastMutexRequest(pNetwork->FastMutex2);
    40214021
    40224022    PINTNETIF pCur = pNetwork->pIFs;
     
    40334033    pNetwork->pTrunkIF = NULL;
    40344034
    4035     RTSemFastMutexRelease(pNetwork->FastMutex);
     4035    RTSemFastMutexRelease(pNetwork->FastMutex2);
    40364036
    40374037    /*
     
    40454045     * Free resources.
    40464046     */
    4047     RTSemFastMutexDestroy(pNetwork->FastMutex);
    4048     pNetwork->FastMutex = NIL_RTSEMFASTMUTEX;
     4047    RTSemFastMutexDestroy(pNetwork->FastMutex2);
     4048    pNetwork->FastMutex2 = NIL_RTSEMFASTMUTEX;
    40494049    RTMemFree(pNetwork);
    40504050
     
    41874187    if (!pNew)
    41884188        return VERR_NO_MEMORY;
    4189     int rc = RTSemFastMutexCreate(&pNew->FastMutex);
     4189    int rc = RTSemFastMutexCreate(&pNew->FastMutex2);
    41904190    if (RT_SUCCESS(rc))
    41914191    {
     
    42494249        rc = VERR_NO_MEMORY;
    42504250
    4251         RTSemFastMutexDestroy(pNew->FastMutex);
    4252         pNew->FastMutex = NIL_RTSEMFASTMUTEX;
     4251        RTSemFastMutexDestroy(pNew->FastMutex2);
     4252        pNew->FastMutex2 = NIL_RTSEMFASTMUTEX;
    42534253    }
    42544254    RTMemFree(pNew);
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