Changeset 28830 in vbox for trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin
- Timestamp:
- Apr 27, 2010 2:05:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/VBoxNetFlt/darwin/VBoxNetFlt-darwin.cpp
r28800 r28830 233 233 * Be careful here to avoid problems racing the detached callback. 234 234 */ 235 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);235 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 236 236 if (!ASMAtomicUoReadBool(&pThis->fDisconnectedFromHost)) 237 237 { … … 240 240 ifnet_reference(pIfNet); 241 241 } 242 RTSpinlockRelease (pThis->hSpinlock, &Tmp);242 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 243 243 244 244 return pIfNet; … … 664 664 * behind it in order to avoid problematic races with the detached callback. 665 665 */ 666 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);666 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 667 667 668 668 pIfNet = (ifnet_t)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pIfNet); … … 677 677 ASMAtomicWriteBool(&pThis->fDisconnectedFromHost, true); 678 678 679 RTSpinlockRelease (pThis->hSpinlock, &Tmp);679 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 680 680 681 681 if (pIfNet) … … 817 817 * Active? Retain the instance and increment the busy counter. 818 818 */ 819 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 820 RTSpinlockAcquire(pThis->hSpinlock, &Tmp); 821 const bool fActive = ASMAtomicUoReadBool(&pThis->fActive); 822 if (fActive) 823 vboxNetFltRetain(pThis, true /* fBusy */); 824 RTSpinlockRelease(pThis->hSpinlock, &Tmp); 825 if (!fActive) 819 if (!vboxNetFltTryRetainBusyActive(pThis)) 826 820 return 0; 827 821 … … 919 913 920 914 RTSPINLOCKTMP Tmp = RTSPINLOCKTMP_INITIALIZER; 921 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);915 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 922 916 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.pIfNet, pIfNet); 923 RTSpinlockRelease (pThis->hSpinlock, &Tmp);917 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 924 918 925 919 /* … … 945 939 Assert(err || pIfFilter); 946 940 947 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);941 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 948 942 pIfNet = (ifnet_t)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pIfNet); 949 943 if (pIfNet && !err) … … 953 947 pIfNet = NULL; /* don't dereference it */ 954 948 } 955 RTSpinlockRelease (pThis->hSpinlock, &Tmp);949 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 956 950 957 951 /* Report capabilities. */ 958 if (!pIfNet) 952 if ( !pIfNet 953 && vboxNetFltTryRetainBusyNotDisconnected(pThis)) 959 954 { 960 955 Assert(pThis->pSwitchPort); … … 963 958 pThis->pSwitchPort->pfnReportGsoCapabilities(pThis->pSwitchPort, 0, INTNETTRUNKDIR_WIRE | INTNETTRUNKDIR_HOST); 964 959 pThis->pSwitchPort->pfnReportNoPreemptDsts(pThis->pSwitchPort, 0 /* none */); 960 vboxNetFltRelease(pThis, true /*fBusy*/); 965 961 } 966 962 } … … 1163 1159 * Carefully obtain the interface filter reference and detach it. 1164 1160 */ 1165 RTSpinlockAcquire (pThis->hSpinlock, &Tmp);1161 RTSpinlockAcquireNoInts(pThis->hSpinlock, &Tmp); 1166 1162 pIfFilter = (interface_filter_t)ASMAtomicUoReadPtr((void * volatile *)&pThis->u.s.pIfFilter); 1167 1163 if (pIfFilter) 1168 1164 ASMAtomicUoWritePtr((void * volatile *)&pThis->u.s.pIfFilter, NULL); 1169 RTSpinlockRelease (pThis->hSpinlock, &Tmp);1165 RTSpinlockReleaseNoInts(pThis->hSpinlock, &Tmp); 1170 1166 1171 1167 if (pIfFilter)
Note:
See TracChangeset
for help on using the changeset viewer.