summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/SynchronizationGcc.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/SynchronizationGcc.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/SynchronizationGcc.c')
-rw-r--r--MdePkg/Library/BaseLib/SynchronizationGcc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/MdePkg/Library/BaseLib/SynchronizationGcc.c b/MdePkg/Library/BaseLib/SynchronizationGcc.c
index 9d57a1f34d..40b1e4a36b 100644
--- a/MdePkg/Library/BaseLib/SynchronizationGcc.c
+++ b/MdePkg/Library/BaseLib/SynchronizationGcc.c
@@ -160,10 +160,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 (
@@ -196,8 +199,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;