Class spinlock

Class Documentation

class legion::core::async::spinlock

Spinlock is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads.

Public Functions

spinlock() = default
spinlock(spinlock &&source) noexcept
spinlock &operator=(spinlock &&source) noexcept
void lock() noexcept

Locks the spinlock, blocks if the spinlock is not available.

bool try_lock() noexcept

Tries to lock the spinlock, returns if the spinlock is not available.

void unlock() noexcept

Unlocks the spinlock.

Public Static Functions

static void force_release(bool release = true)

Forces lock to no longer care about thread safety start shutting down. Should be called after all threads have been destroyed.