stdex Additional custom or not Standard C++ covered algorithms

Loading...
Searching...
No Matches
Public Member Functions | List of all members
stdex::spinlock Class Reference

Spin-lock. More...

`#include <stdex/spinlock.hpp>`

## Public Member Functions
void | lock () noexcept
| Blocks until a lock can be acquired for the current execution agent (thread, process, task).
bool | try_lock () noexcept
| Attempts to acquire the lock for the current execution agent (thread, process, task) without blocking.
void | unlock () noexcept
| Releases the non-shared lock held by the execution agent.

## Detailed Description

Spin-lock.

See also
  Correctly implementing a spinlock in C++

## Member Function Documentation

## ◆ try_lock()

bool stdex::spinlock::try_lock | ( |  | ) |
| inline noexcept

Attempts to acquire the lock for the current execution agent (thread, process, task) without blocking.

Returns
  true if the lock was acquired, false otherwise

The documentation for this class was generated from the following file:

- include/stdex/spinlock.hpp