Document TransitionLock semantics and RCU intent
Rumor has it, NT is one of the few kernels that actually has RCU (alongside Linux and maybe some IBM things). So maybe if we ever learn how to use NT's RCU functionality, we'll be able to replace this with that.
This commit is contained in:
parent
888cad7f2a
commit
86e425a0dc
4
wintun.c
4
wintun.c
@ -56,6 +56,10 @@ typedef enum _TUN_STATE {
|
|||||||
typedef struct _TUN_CTX {
|
typedef struct _TUN_CTX {
|
||||||
volatile TUN_STATE State;
|
volatile TUN_STATE State;
|
||||||
volatile NDIS_DEVICE_POWER_STATE PowerState;
|
volatile NDIS_DEVICE_POWER_STATE PowerState;
|
||||||
|
|
||||||
|
/* Used like RCU. When we're making use of queues, we take a shared lock. When we want to
|
||||||
|
* drain the queues and toggle the state, we take an exclusive lock before toggling the
|
||||||
|
* atomic and then releasing. It's similar to setting the atomic and then calling rcu_barrier(). */
|
||||||
EX_SPIN_LOCK TransitionLock;
|
EX_SPIN_LOCK TransitionLock;
|
||||||
|
|
||||||
NDIS_HANDLE MiniportAdapterHandle;
|
NDIS_HANDLE MiniportAdapterHandle;
|
||||||
|
Loading…
Reference in New Issue
Block a user