NdisAcquireSpinLock (Compact 2013)
3/26/2014
This function acquires a spin lock so that the caller gains exclusive access to the resources, shared among driver functions, that the spin lock protects.
Syntax
VOID NdisAcquireSpinLock(
PNDIS_SPIN_LOCK SpinLock
);
Parameters
- SpinLock
[in] Pointer to an opaque spin lock, already initialized by the caller.
Return Value
None.
Remarks
The driver must initialize a variable of type NDIS_SPIN_LOCK with NdisAllocateSpinLock before it calls any other NdisXxxSpinLock function. The driver must provide resident storage for the spin lock(s) it uses.
After acquiring a spin lock with NdisAcquireSpinLock, the caller must release that lock with a call to NdisReleaseSpinLock. A driver must call NdisReleaseSpinLock following each call to NdisAcquireSpinLock. Otherwise, a deadlock occurs, causing the driver to not respond.
A spin lock acquired with NdisAcquireSpinLock must be released with NdisReleaseSpinLock. A spin lock acquired with NdisDprAcquireSpinLock must be released with NdisDprReleaseSpinLock.
A driver should never hold a spin lock for an extended period (more than a few instructions). Holding a spin lock for longer than 25 microseconds degrades both system and driver performance.
A miniport driver cannot use a spin lock to protect resources that its other functions share with the MiniportInterrupt and/or MiniportDisableInterruptEx functions. Instead, a miniport driver must call NdisMSynchronizeWithInterruptEx so that its MiniportSynchronizeInterrupt function accesses such shared resources at the same DIRQL at which its MiniportInterrupt and/or MiniportDisableInterruptEx functions do.
For more information about acquiring and releasing NDIS spin locks, see Synchronization and Notification in Network Drivers.
Requirements
Header |
ndis.h |
Library |
ndis.lib |
See Also
Reference
NDIS Spin Lock Interface
MiniportDisableInterrupt
MiniportISR
MiniportSynchronizeISR
MiniportHaltEx
MiniportInitializeEx
NdisAllocateSpinLock
NdisDprAcquireSpinLock
NdisDprReleaseSpinLock
NdisMSynchronizeWithInterrupt
NdisMSynchronizeWithInterruptEx
NdisReleaseSpinLock