mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 17:05:46 +00:00
- More fixes to pushlock implementation:
* In ExTimedWaitForUnblockPushLock, check only for STATUS_SUCCESS (which is the only status return when the wait was satisfied, while other like STATUS_TIMEOUT would still be considered a success). * In ExBlockPushlock, fix a typo when trying out an interlocked exchange with a new value - wrong value was assigned. * In ExfAcquirePushLockShared, assign PushLock value passed to this function, not the NewValue, like it's done in ExfAcquirePushLockExclusive. * In ExfReleaseReleasePushLockExclusive, fix a typo which led to incorrect behavior and not waking up the pushlock when it should be. svn path=/trunk/; revision=34008
This commit is contained in:
parent
67572c740e
commit
ab2b63b87b
1 changed files with 7 additions and 6 deletions
|
@ -343,9 +343,10 @@ ExTimedWaitForUnblockPushLock(IN PEX_PUSH_LOCK PushLock,
|
|||
KernelMode,
|
||||
FALSE,
|
||||
Timeout);
|
||||
if (!NT_SUCCESS(Status))
|
||||
/* Check if the wait was satisfied */
|
||||
if (Status != STATUS_SUCCESS)
|
||||
{
|
||||
/* Try unblocking the pushlock */
|
||||
/* Try unblocking the pushlock if it was not */
|
||||
ExfUnblockPushLock(PushLock, WaitBlock);
|
||||
}
|
||||
}
|
||||
|
@ -432,7 +433,7 @@ ExBlockPushLock(PEX_PUSH_LOCK PushLock,
|
|||
if (OldValue.Ptr == NewValue.Ptr) break;
|
||||
|
||||
/* Try again with the new value */
|
||||
NewValue = OldValue;
|
||||
OldValue = NewValue;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -657,7 +658,7 @@ ExfAcquirePushLockShared(PEX_PUSH_LOCK PushLock)
|
|||
if (NewValue.Value != OldValue.Value)
|
||||
{
|
||||
/* Retry */
|
||||
OldValue = NewValue;
|
||||
OldValue = *PushLock;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -721,7 +722,7 @@ ExfAcquirePushLockShared(PEX_PUSH_LOCK PushLock)
|
|||
if (NewValue.Ptr != OldValue.Ptr)
|
||||
{
|
||||
/* Retry */
|
||||
OldValue = NewValue;
|
||||
OldValue = *PushLock;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -1088,7 +1089,7 @@ ExfReleasePushLockExclusive(PEX_PUSH_LOCK PushLock)
|
|||
OldValue.Ptr);
|
||||
|
||||
/* Check if the value changed behind our back */
|
||||
if (NewValue.Value != OldValue.Value)
|
||||
if (NewValue.Value == OldValue.Value)
|
||||
{
|
||||
/* Wake the Pushlock */
|
||||
ExfWakePushLock(PushLock, WakeValue);
|
||||
|
|
Loading…
Reference in a new issue