Ultralight C++ API 1.4.0
|
#include <Ultralight/Lock.h>
Tiny, efficient spinlock that is optimized for short locking periods but will still intelligently yield the current thread and save CPU if the lock is held longer.
Can be used in place of std::mutex since it implements the STL's Lockable interface.
Public Member Functions | |
constexpr | Lock ()=default |
UL_ALWAYS_INLINE void | lock () noexcept |
UL_ALWAYS_INLINE bool | try_lock () noexcept |
UL_ALWAYS_INLINE void | unlock () noexcept |
Protected Member Functions | |
Lock (const Lock &)=delete | |
Lock & | operator= (const Lock &)=delete |
void | contended_lock () noexcept |
Protected Attributes | |
std::atomic< bool > | lock_ = { 0 } |
|
constexprdefault |
|
protectednoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
protected |