mcrl2::utilities::spinlock

Include file:

#include "mcrl2/utilities/spinlock.h
class mcrl2::utilities::spinlock

Implements a very simple spinlock.

Private attributes

std::atomic_flag mcrl2::utilities::spinlock::m_flag

Public member functions

void lock()

Busy waits until the lock is unlocked.

bool try_lock()

Tries to lock the spinlock, but also returns immediately.

Returns: Whether the lock was acquired succesfully.

void unlock()

Frees the lock.