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; }
45 LUNCHBOX_API ~SpinLock();
48 LUNCHBOX_API
void set();
51 LUNCHBOX_API
void unset();
59 LUNCHBOX_API
bool trySet();
62 LUNCHBOX_API
void setRead();
65 LUNCHBOX_API
void unsetRead();
73 LUNCHBOX_API
bool trySetRead();
81 LUNCHBOX_API
bool isSet();
89 LUNCHBOX_API
bool isSetWrite();
97 LUNCHBOX_API
bool isSetRead();
100 detail::SpinLock*
const _impl;
103 #endif //LUNCHBOX_SPINLOCK_H A fast lock for uncontended memory access.
Abstraction layer and common utilities for multi-threaded programming.