summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/SynchronizationMsc.c
diff options
context:
space:
mode:
authoryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2007-04-03 07:13:38 +0000
committeryshang1 <yshang1@6f19259b-4bc3-4df7-8a09-765794883524>2007-04-03 07:13:38 +0000
commita4e9aab95ada479253077229f442f5c455c7bfdd (patch)
tree0ca098dd4cfbe591c1d99f584f1cc8f54cf99aea /MdePkg/Library/BaseLib/SynchronizationMsc.c
parent1fcc1b796c0323cfc1e8c67a1454dc1f8324dab6 (diff)
downloadedk2-platforms-a4e9aab95ada479253077229f442f5c455c7bfdd.tar.xz
Updated MSA file for EBC.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@2526 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BaseLib/SynchronizationMsc.c')
-rw-r--r--MdePkg/Library/BaseLib/SynchronizationMsc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/MdePkg/Library/BaseLib/SynchronizationMsc.c b/MdePkg/Library/BaseLib/SynchronizationMsc.c
index fb10b5d01b..ce330aed88 100644
--- a/MdePkg/Library/BaseLib/SynchronizationMsc.c
+++ b/MdePkg/Library/BaseLib/SynchronizationMsc.c
@@ -162,10 +162,13 @@ AcquireSpinLockOrFail (
IN OUT SPIN_LOCK *SpinLock
)
{
- VOID *Result;
+ SPIN_LOCK LockValue;
+ VOID *Result;
ASSERT (SpinLock != NULL);
- ASSERT (*SpinLock == SPIN_LOCK_ACQUIRED || *SpinLock == SPIN_LOCK_RELEASED);
+
+ LockValue = *SpinLock;
+ ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);
_ReadWriteBarrier ();
Result = InterlockedCompareExchangePointer (
@@ -198,8 +201,12 @@ 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);
_ReadWriteBarrier ();
*SpinLock = SPIN_LOCK_RELEASED;