Changeset 28438 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Apr 17, 2010 9:58:52 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r28430 r28438 5 5 6 6 /* 7 * Copyright (C) 2006-20 08Sun Microsystems, Inc.7 * Copyright (C) 2006-2010 Sun Microsystems, Inc. 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 359 359 * another mutex for creation / destruction serilization. */ 360 360 #endif 361 RTSEMFASTMUTEX FastMutex ;361 RTSEMFASTMUTEX FastMutex2; 362 362 #ifdef WITH_NEW_STUFF 363 363 /** Wait for an interface to stop being busy so it can be removed or have its … … 2020 2020 || intnetR0TrunkIfRetain(pThis)) 2021 2021 { 2022 rc = RTSemFastMutexRelease(pNetwork->FastMutex );2022 rc = RTSemFastMutexRelease(pNetwork->FastMutex2); 2023 2023 AssertRC(rc); 2024 2024 if (RT_SUCCESS(rc)) … … 2042 2042 } 2043 2043 2044 int rc2 = RTSemFastMutexRequest(pNetwork->FastMutex );2044 int rc2 = RTSemFastMutexRequest(pNetwork->FastMutex2); 2045 2045 AssertRC(rc2); 2046 2046 } … … 2636 2636 */ 2637 2637 PINTNETNETWORK pNetwork = pIf->pNetwork; 2638 int rc = RTSemFastMutexRequest(pNetwork->FastMutex );2638 int rc = RTSemFastMutexRequest(pNetwork->FastMutex2); 2639 2639 if (RT_FAILURE(rc)) 2640 2640 { … … 2645 2645 if (pTrunkIf) 2646 2646 { 2647 RTSemFastMutexRelease(pIf->pNetwork->FastMutex );2647 RTSemFastMutexRelease(pIf->pNetwork->FastMutex2); 2648 2648 2649 2649 if (!intnetR0TrunkIfOutLock(pTrunkIf)) … … 2654 2654 } 2655 2655 2656 rc = RTSemFastMutexRequest(pNetwork->FastMutex );2656 rc = RTSemFastMutexRequest(pNetwork->FastMutex2); 2657 2657 if (RT_FAILURE(rc)) 2658 2658 { … … 2711 2711 * Release the semaphore(s) and release references. 2712 2712 */ 2713 rc = RTSemFastMutexRelease(pNetwork->FastMutex );2713 rc = RTSemFastMutexRelease(pNetwork->FastMutex2); 2714 2714 if (pTrunkIf) 2715 2715 { … … 2767 2767 * allocating the buffer. 2768 2768 */ 2769 int rc = RTSemFastMutexRequest(pIf->pNetwork->FastMutex );2769 int rc = RTSemFastMutexRequest(pIf->pNetwork->FastMutex2); 2770 2770 if (RT_SUCCESS(rc)) 2771 2771 { 2772 2772 *ppRing3Buf = pIf->pIntBufR3; 2773 rc = RTSemFastMutexRelease(pIf->pNetwork->FastMutex );2773 rc = RTSemFastMutexRelease(pIf->pNetwork->FastMutex2); 2774 2774 } 2775 2775 … … 2823 2823 * ASSUMES that the handle isn't closed while we're here. 2824 2824 */ 2825 int rc = RTSemFastMutexRequest(pIf->pNetwork->FastMutex );2825 int rc = RTSemFastMutexRequest(pIf->pNetwork->FastMutex2); 2826 2826 if (RT_SUCCESS(rc)) 2827 2827 { 2828 2828 *ppRing0Buf = pIf->pIntBuf; 2829 2829 2830 rc = RTSemFastMutexRelease(pIf->pNetwork->FastMutex );2830 rc = RTSemFastMutexRelease(pIf->pNetwork->FastMutex2); 2831 2831 } 2832 2832 intnetR0IfRelease(pIf, pSession); … … 2907 2907 if (pNetwork) 2908 2908 { 2909 rc = RTSemFastMutexRequest(pNetwork->FastMutex );2909 rc = RTSemFastMutexRequest(pNetwork->FastMutex2); 2910 2910 if (RT_SUCCESS(rc)) 2911 2911 { … … 2917 2917 } 2918 2918 2919 rc = RTSemFastMutexRelease(pNetwork->FastMutex );2919 rc = RTSemFastMutexRelease(pNetwork->FastMutex2); 2920 2920 } 2921 2921 } … … 2976 2976 if (pNetwork) 2977 2977 { 2978 rc = RTSemFastMutexRequest(pNetwork->FastMutex );2978 rc = RTSemFastMutexRequest(pNetwork->FastMutex2); 2979 2979 if (RT_SUCCESS(rc)) 2980 2980 { … … 2987 2987 } 2988 2988 2989 rc = RTSemFastMutexRelease(pNetwork->FastMutex );2989 rc = RTSemFastMutexRelease(pNetwork->FastMutex2); 2990 2990 } 2991 2991 } … … 3040 3040 return VERR_SEM_DESTROYED; 3041 3041 3042 int rc = RTSemFastMutexRequest(pNetwork->FastMutex ); AssertRC(rc);3042 int rc = RTSemFastMutexRequest(pNetwork->FastMutex2); AssertRC(rc); 3043 3043 if (RT_SUCCESS(rc)) 3044 3044 { … … 3064 3064 * the network semaphore so we don't create any deadlocks. 3065 3065 */ 3066 int rc2 = RTSemFastMutexRelease(pNetwork->FastMutex ); AssertRC(rc2);3066 int rc2 = RTSemFastMutexRelease(pNetwork->FastMutex2); AssertRC(rc2); 3067 3067 fNetworkLocked = false; 3068 3068 … … 3073 3073 3074 3074 if (fNetworkLocked) 3075 RTSemFastMutexRelease(pNetwork->FastMutex );3075 RTSemFastMutexRelease(pNetwork->FastMutex2); 3076 3076 } 3077 3077 if (pTrunkIf) … … 3418 3418 { 3419 3419 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; 3424 3424 } 3425 3425 … … 3521 3521 * Link the interface to the network. 3522 3522 */ 3523 rc = RTSemFastMutexRequest(pNetwork->FastMutex );3523 rc = RTSemFastMutexRequest(pNetwork->FastMutex2); 3524 3524 if (RT_SUCCESS(rc)) 3525 3525 { 3526 3526 pIf->pNext = pNetwork->pIFs; 3527 3527 pNetwork->pIFs = pIf; 3528 RTSemFastMutexRelease(pNetwork->FastMutex );3528 RTSemFastMutexRelease(pNetwork->FastMutex2); 3529 3529 3530 3530 /* … … 3548 3548 } 3549 3549 3550 RTSemFastMutexDestroy(pNetwork->FastMutex );3551 pNetwork->FastMutex = NIL_RTSEMFASTMUTEX;3550 RTSemFastMutexDestroy(pNetwork->FastMutex2); 3551 pNetwork->FastMutex2 = NIL_RTSEMFASTMUTEX; 3552 3552 } 3553 3553 … … 3604 3604 /* assert some sanity */ 3605 3605 AssertPtrReturn(pNetwork, INTNETSWDECISION_TRUNK); 3606 AssertReturn(pNetwork->FastMutex != NIL_RTSEMFASTMUTEX, INTNETSWDECISION_TRUNK);3606 AssertReturn(pNetwork->FastMutex2 != NIL_RTSEMFASTMUTEX, INTNETSWDECISION_TRUNK); 3607 3607 AssertPtr(pvSrc); 3608 3608 AssertPtr(cbSrc >= 6); … … 3623 3623 /* assert some sanity */ 3624 3624 AssertPtrReturn(pNetwork, false); 3625 AssertReturn(pNetwork->FastMutex != NIL_RTSEMFASTMUTEX, false);3625 AssertReturn(pNetwork->FastMutex2 != NIL_RTSEMFASTMUTEX, false); 3626 3626 AssertPtr(pSG); 3627 3627 Assert(fSrc); … … 3630 3630 * Lock the network and send the frame to it. 3631 3631 */ 3632 int rc = RTSemFastMutexRequest(pNetwork->FastMutex );3632 int rc = RTSemFastMutexRequest(pNetwork->FastMutex2); 3633 3633 AssertRCReturn(rc, false); 3634 3634 … … 3639 3639 fRc = false; /* don't drop it */ 3640 3640 3641 rc = RTSemFastMutexRelease(pNetwork->FastMutex );3641 rc = RTSemFastMutexRelease(pNetwork->FastMutex2); 3642 3642 AssertRC(rc); 3643 3643 … … 3654 3654 /* assert some sanity */ 3655 3655 AssertPtrReturnVoid(pNetwork); 3656 AssertReturnVoid(pNetwork->FastMutex != NIL_RTSEMFASTMUTEX);3656 AssertReturnVoid(pNetwork->FastMutex2 != NIL_RTSEMFASTMUTEX); 3657 3657 AssertPtr(pSG); 3658 3658 Assert(pSG->cUsers > 0 && pSG->cUsers < 256); … … 3671 3671 /* assert some sanity */ 3672 3672 AssertPtrReturnVoid(pNetwork); 3673 AssertReturnVoid(pNetwork->FastMutex != NIL_RTSEMFASTMUTEX);3673 AssertReturnVoid(pNetwork->FastMutex2 != NIL_RTSEMFASTMUTEX); 3674 3674 AssertPtr(pSG); 3675 3675 Assert(pSG->cUsers > 0); … … 4018 4018 * deal with this by simply orphaning the interfaces. 4019 4019 */ 4020 RTSemFastMutexRequest(pNetwork->FastMutex );4020 RTSemFastMutexRequest(pNetwork->FastMutex2); 4021 4021 4022 4022 PINTNETIF pCur = pNetwork->pIFs; … … 4033 4033 pNetwork->pTrunkIF = NULL; 4034 4034 4035 RTSemFastMutexRelease(pNetwork->FastMutex );4035 RTSemFastMutexRelease(pNetwork->FastMutex2); 4036 4036 4037 4037 /* … … 4045 4045 * Free resources. 4046 4046 */ 4047 RTSemFastMutexDestroy(pNetwork->FastMutex );4048 pNetwork->FastMutex = NIL_RTSEMFASTMUTEX;4047 RTSemFastMutexDestroy(pNetwork->FastMutex2); 4048 pNetwork->FastMutex2 = NIL_RTSEMFASTMUTEX; 4049 4049 RTMemFree(pNetwork); 4050 4050 … … 4187 4187 if (!pNew) 4188 4188 return VERR_NO_MEMORY; 4189 int rc = RTSemFastMutexCreate(&pNew->FastMutex );4189 int rc = RTSemFastMutexCreate(&pNew->FastMutex2); 4190 4190 if (RT_SUCCESS(rc)) 4191 4191 { … … 4249 4249 rc = VERR_NO_MEMORY; 4250 4250 4251 RTSemFastMutexDestroy(pNew->FastMutex );4252 pNew->FastMutex = NIL_RTSEMFASTMUTEX;4251 RTSemFastMutexDestroy(pNew->FastMutex2); 4252 pNew->FastMutex2 = NIL_RTSEMFASTMUTEX; 4253 4253 } 4254 4254 RTMemFree(pNew);
Note:
See TracChangeset
for help on using the changeset viewer.