mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 01:39:30 +00:00
[HAL]
Don't spin with an interlocked operation. svn path=/branches/ros-amd64-bringup/; revision=44849
This commit is contained in:
parent
a1bc42e31a
commit
d786ac57d2
1 changed files with 3 additions and 2 deletions
|
@ -35,8 +35,9 @@ HalpAcquireSystemHardwareSpinLock(VOID)
|
|||
/* Try to acquire the lock */
|
||||
while (InterlockedBitTestAndSet((PLONG)&HalpSystemHardwareLock, 0))
|
||||
{
|
||||
/* Lock is held, short wait and try again */
|
||||
YieldProcessor();
|
||||
/* Lock is held, spin until it's free */
|
||||
while (*(volatile ULONG*)HalpSystemHardwareLock & 1)
|
||||
YieldProcessor();
|
||||
}
|
||||
|
||||
/* We have the lock, save the flags now */
|
||||
|
|
Loading…
Reference in a new issue