mirror of https://github.com/acidanthera/audk.git
Change SPIN_LOCK_ACQUIRED to 1 and SPIN_LOCK_RELEASED to 2 according to MWG.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@310 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4c114006de
commit
277872438c
|
@ -14,8 +14,8 @@
|
|||
|
||||
**/
|
||||
|
||||
#define SPIN_LOCK_RELEASED ((SPIN_LOCK)0)
|
||||
#define SPIN_LOCK_ACQUIRED ((SPIN_LOCK)-1)
|
||||
#define SPIN_LOCK_RELEASED ((SPIN_LOCK)1)
|
||||
#define SPIN_LOCK_ACQUIRED ((SPIN_LOCK)2)
|
||||
|
||||
UINT32
|
||||
EFIAPI
|
||||
|
@ -94,7 +94,7 @@ InitializeSpinLock (
|
|||
)
|
||||
{
|
||||
ASSERT (SpinLock != NULL);
|
||||
*SpinLock = 0;
|
||||
*SpinLock = SPIN_LOCK_RELEASED;
|
||||
return SpinLock;
|
||||
}
|
||||
|
||||
|
@ -178,6 +178,7 @@ AcquireSpinLockOrFail (
|
|||
)
|
||||
{
|
||||
ASSERT (SpinLock != NULL);
|
||||
ASSERT (*SpinLock == SPIN_LOCK_ACQUIRED || *SpinLock == SPIN_LOCK_RELEASED);
|
||||
return (BOOLEAN)(
|
||||
InterlockedCompareExchangePointer (
|
||||
(VOID**)SpinLock,
|
||||
|
@ -208,7 +209,8 @@ ReleaseSpinLock (
|
|||
)
|
||||
{
|
||||
ASSERT (SpinLock != NULL);
|
||||
*SpinLock = 0;
|
||||
ASSERT (*SpinLock == SPIN_LOCK_ACQUIRED || *SpinLock == SPIN_LOCK_RELEASED);
|
||||
*SpinLock = SPIN_LOCK_RELEASED;
|
||||
return SpinLock;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue