message: SpinLock: minor update
diff: #include <atomic>
  #include <mutex>
  +#include "../../Platforms/Basic/interface/DebugUtilities.hpp"
  +
  namespace Threading
  {
  @@ -54,12 +56,12 @@ public:
  // Note that original implementation uses memory_order_acquire,
  // but there is an opinion that this may cause a dead lock in certain
  // scenarios, so we will be on the safe side with memory_order_seq_cst.
  - const auto OrigValue = m_IsLocked.exchange(true /*, std::memory_order_acquire*/);
  - if (OrigValue == false)
  - return; // The lock has not been previously acquired
  + const auto WasLocked = m_IsLocked.exchange(true /*, std::memory_order_acquire*/);
  + if (!WasLocked)
  + return; // The lock was not acquired when this thread performed the exchange
  // Wait for the lock to be released without generating cache misses.
  - while (m_IsLocked.load(std::memory_order_relaxed))
  + while (is_locked())
  {
  // Issue X86 PAUSE or ARM YIELD instruction to reduce contention between
  // hyper-threads.
  @@ -72,24 +74,27 @@ public:
  {
  // First do a relaxed load to check if lock is free in order to prevent
  // unnecessary cache misses if someone does while (!try_lock()).
  - if (m_IsLocked.load(std::memory_order_relaxed))
  + if (is_locked())
  return false;
  // Note that original implementation uses memory_order_acquire,
  // but there is an opinion that this may cause a dead lock in certain
  // scenarios, so we will be on the safe side with memory_order_seq_cst.
  - const auto OrigValue = m_IsLocked.exchange(true /*, std::memory_order_acquire*/);
  - return OrigValue == false;
  + const auto WasLocked = m_IsLocked.exchange(true /*, std::memory_order_acquire*/);
  + return !WasLocked;
  }
  void unlock() noexcept
  {
  + VERIFY(is_locked(), "Attempting to unlock a spin lock that is not locked. This is a strong indication of a flawed logic.");
  m_IsLocked.store(false /*, std::memory_order_release*/);
  }
  bool is_locked() const noexcept
  {
  - return m_IsLocked.load();
  + // Use relaxed load as we only want to check the value.
  + // To impose ordering, lock()/try_lock() must be used.
  + return m_IsLocked.load(std::memory_order_relaxed);
  }
  private:
  