mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[NTOS:CM] Implement the shared lock macro for use
CmpAcquireKcbLockSharedByKey can come in handy for use to lock KCBs by their convkey with a shared lock, specifically we would need this for cache lookup stuff.
This commit is contained in:
parent
26fe3616fe
commit
8a335a3141
1 changed files with 18 additions and 8 deletions
|
@ -89,6 +89,14 @@
|
|||
(GET_HASH_ENTRY(CmpCacheTable, \
|
||||
(k)->ConvKey)->Owner == KeGetCurrentThread())
|
||||
|
||||
//
|
||||
// Shared acquires a KCB by index
|
||||
//
|
||||
#define CmpAcquireKcbLockSharedByIndex(i) \
|
||||
{ \
|
||||
ExAcquirePushLockShared(&CmpCacheTable[(i)].Lock); \
|
||||
}
|
||||
|
||||
//
|
||||
// Exclusively acquires a KCB by index
|
||||
//
|
||||
|
@ -120,6 +128,16 @@ CmpAcquireKcbLockExclusiveByKey(IN ULONG ConvKey)
|
|||
CmpAcquireKcbLockExclusiveByIndex(GET_HASH_INDEX(ConvKey));
|
||||
}
|
||||
|
||||
//
|
||||
// Shared acquires a KCB by key
|
||||
//
|
||||
FORCEINLINE
|
||||
VOID
|
||||
CmpAcquireKcbLockSharedByKey(
|
||||
_In_ ULONG ConvKey)
|
||||
{
|
||||
CmpAcquireKcbLockSharedByIndex(GET_HASH_INDEX(ConvKey));
|
||||
}
|
||||
|
||||
//
|
||||
// Shared acquires a KCB
|
||||
|
@ -130,14 +148,6 @@ CmpAcquireKcbLockExclusiveByKey(IN ULONG ConvKey)
|
|||
(k)->ConvKey)->Lock); \
|
||||
}
|
||||
|
||||
//
|
||||
// Shared acquires a KCB by index
|
||||
//
|
||||
#define CmpAcquireKcbLockSharedByIndex(i) \
|
||||
{ \
|
||||
ExAcquirePushLockShared(&CmpCacheTable[(i)].Lock); \
|
||||
}
|
||||
|
||||
//
|
||||
// Tries to convert a KCB lock
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue