18 #ifndef LUNCHBOX_SPINLOCK_H
19 #define LUNCHBOX_SPINLOCK_H
21 #include <lunchbox/atomic.h>
22 #include <lunchbox/thread.h>
26 namespace detail {
class SpinLock; }
48 LUNCHBOX_API
void set();
51 LUNCHBOX_API
void unset();
59 LUNCHBOX_API
bool trySet();
81 LUNCHBOX_API
bool isSet();
100 detail::SpinLock*
const _impl;
103 #endif //LUNCHBOX_SPINLOCK_H
LUNCHBOX_API bool isSetWrite()
Test if the lock is set exclusively.
LUNCHBOX_API void unsetRead()
Release a shared read lock.
LUNCHBOX_API ~SpinLock()
Destruct the lock.
LUNCHBOX_API bool isSet()
Test if the lock is set.
LUNCHBOX_API void setRead()
Acquire the lock shared with other readers.
A fast lock for uncontended memory access.
LUNCHBOX_API SpinLock()
Construct a new lock.
LUNCHBOX_API bool trySet()
Attempt to acquire the lock exclusively.
LUNCHBOX_API void unset()
Release an exclusive lock.
Abstraction layer and common utilities for multi-threaded programming.
LUNCHBOX_API bool isSetRead()
Test if the lock is set shared.
LUNCHBOX_API void set()
Acquire the lock exclusively.
LUNCHBOX_API bool trySetRead()
Attempt to acquire the lock shared with other readers.