20#ifndef __KICAD_SPINLOCK_H
21#define __KICAD_SPINLOCK_H
38 while(
m_lock.exchange(
true, std::memory_order_acquire ) );
43 return !
m_lock.exchange(
true, std::memory_order_acquire );
48 m_lock.store(
false, std::memory_order_release );
53 return m_lock.load( std::memory_order_acquire );
A trivial spinlock implementation with no optimization.
std::atomic< bool > m_lock