/* Initialize a basic mutual exclusion lock. Each lock provides mutual exclusion access at it's task priority level. Since there is no-premption (at any TPL) or multiprocessor support, acquiring the lock only consists of raising to the locks TPL. */
EFI_STATUS CoreAcquireLockOrFail(IN EFI_LOCK *Lock)
/* Initialize a basic mutual exclusion lock. Each lock provides mutual exclusion access at it's task priority level. Since there is no-premption (at any TPL) or multiprocessor support, acquiring the lock only consists of raising to the locks TPL. */
EFI_STATUS CoreAcquireLockOrFail(IN EFI_LOCK *Lock)
{
  ASSERT (Lock != NULL);
  ASSERT (Lock->Lock != EfiLockUninitialized);
  if (Lock->Lock == EfiLockAcquired) {
    return EFI_ACCESS_DENIED;
  }
  Lock->OwnerTpl = CoreRaiseTpl (Lock->Tpl);
  Lock->Lock = EfiLockAcquired;
  return EFI_SUCCESS;
}