git-svn-id: https://edk2.tianocore.org/svn/edk2/trunk@1931 de2fecce-e211-0410-80a6...
authorxli24 <xli24@de2fecce-e211-0410-80a6-f3fac2684e05>
Mon, 13 Nov 2006 03:40:52 +0000 (03:40 +0000)
committerxli24 <xli24@de2fecce-e211-0410-80a6-f3fac2684e05>
Mon, 13 Nov 2006 03:40:52 +0000 (03:40 +0000)
edk2/MdePkg/Library/BaseLib/Synchronization.c

index cf001ce..5033133 100644 (file)
@@ -236,8 +236,13 @@ AcquireSpinLockOrFail (
   IN OUT  SPIN_LOCK                 *SpinLock\r
   )\r
 {\r
+  SPIN_LOCK    LockValue;\r
+\r
   ASSERT (SpinLock != NULL);\r
-  ASSERT (*SpinLock == SPIN_LOCK_ACQUIRED || *SpinLock == SPIN_LOCK_RELEASED);\r
+\r
+  LockValue = *SpinLock;\r
+  ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);\r
+\r
   return (BOOLEAN)(\r
            InterlockedCompareExchangePointer (\r
              (VOID**)SpinLock,\r
@@ -267,8 +272,13 @@ ReleaseSpinLock (
   IN OUT  SPIN_LOCK                 *SpinLock\r
   )\r
 {\r
+  SPIN_LOCK    LockValue;\r
+\r
   ASSERT (SpinLock != NULL);\r
-  ASSERT (*SpinLock == SPIN_LOCK_ACQUIRED || *SpinLock == SPIN_LOCK_RELEASED);\r
+\r
+  LockValue = *SpinLock;\r
+  ASSERT (LockValue == SPIN_LOCK_ACQUIRED || LockValue == SPIN_LOCK_RELEASED);\r
+\r
   *SpinLock = SPIN_LOCK_RELEASED;\r
   return SpinLock;\r
 }\r