18 #ifndef LUNCHBOX_LOCK_H
19 #define LUNCHBOX_LOCK_H
22 #include <lunchbox/compiler.h>
23 #include <boost/noncopyable.hpp>
27 namespace detail {
class Lock; }
36 class Lock :
public boost::noncopyable
46 LUNCHBOX_API
void set();
49 LUNCHBOX_API
void unset();
66 LUNCHBOX_API
bool trySet();
75 LUNCHBOX_API
bool isSet();
78 detail::Lock*
const _impl;
81 #endif //LUNCHBOX_LOCK_H
Defines export visibility macros for library Lunchbox.
void unset()
Release the lock.
void set()
Acquire the lock.
void setRead()
Acquire the lock shared with other readers.
bool trySet()
Attempt to acquire the lock.
Lock()
Construct a new lock.
bool isSet()
Test if the lock is set.
void unsetRead()
Release a shared read lock.
Abstraction layer and common utilities for multi-threaded programming.
A lock (mutex) primitive.
~Lock()
Destruct the lock.