diff options
author | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-13 03:40:52 +0000 |
---|---|---|
committer | xli24 <xli24@6f19259b-4bc3-4df7-8a09-765794883524> | 2006-11-13 03:40:52 +0000 |
commit | c9708dddc1a2d10725860d5e9ac1b4929d0b43f4 (patch) | |
tree | a6ba2ae59088a4db28c658863750982b828c8cb0 /MdePkg/Library | |
parent | d73991a143dc3200a47b50ecfd184ee43ede7900 (diff) | |
download | edk2-platforms-c9708dddc1a2d10725860d5e9ac1b4929d0b43f4.tar.xz |
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@1931 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library')
-rw-r--r-- | MdePkg/Library/BaseLib/Synchronization.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/MdePkg/Library/BaseLib/Synchronization.c b/MdePkg/Library/BaseLib/Synchronization.c index cf001ce4d1..5033133224 100644 --- a/MdePkg/Library/BaseLib/Synchronization.c +++ b/MdePkg/Library/BaseLib/Synchronization.c @@ -236,8 +236,13 @@ AcquireSpinLockOrFail ( IN OUT SPIN_LOCK *SpinLock
)
{
+ SPIN_LOCK LockValue;
+
ASSERT (SpinLock != NULL);
- ASSERT (*SpinLock == SPIN_LOCK_ACQUIRED || *SpinLock == SPIN_LOCK_RELEASED);
+
+ LockValue = *SpinLock;
+ ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
+
return (BOOLEAN)(
InterlockedCompareExchangePointer (
(VOID**)SpinLock,
@@ -267,8 +272,13 @@ ReleaseSpinLock ( IN OUT SPIN_LOCK *SpinLock
)
{
+ SPIN_LOCK LockValue;
+
ASSERT (SpinLock != NULL);
- ASSERT (*SpinLock == SPIN_LOCK_ACQUIRED || *SpinLock == SPIN_LOCK_RELEASED);
+
+ LockValue = *SpinLock;
+ ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
+
*SpinLock = SPIN_LOCK_RELEASED;
return SpinLock;
}
|