mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
added some lock-free structures
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@1719 21ef857c-d57f-4fe0-8362-d861dc6d29cd
This commit is contained in:
@@ -76,13 +76,8 @@ FORCEINLINE VOID KphAcquireBitSpinLock(
|
||||
__in LONG Bit
|
||||
)
|
||||
{
|
||||
/* Fast path - try to acquire the lock outside of the loop first. */
|
||||
if (InterlockedBitTestAndSet(Value, Bit))
|
||||
{
|
||||
/* Slow path - lock was already acquired by someone else; spin. */
|
||||
while (InterlockedBitTestAndSet(Value, Bit))
|
||||
YieldProcessor();
|
||||
}
|
||||
while (InterlockedBitTestAndSet(Value, Bit))
|
||||
YieldProcessor();
|
||||
}
|
||||
|
||||
/* KphReleaseBitSpinLock
|
||||
|
||||
Reference in New Issue
Block a user