18 #ifndef FOEDUS_SOC_SHARED_MUTEX_HPP_
19 #define FOEDUS_SOC_SHARED_MUTEX_HPP_
88 pthread_mutex_t mutex_;
89 pthread_mutexattr_t attr_;
103 : mutex_(mutex), locked_by_me_(false) {
104 if (lock_initially) {
127 #endif // FOEDUS_SOC_SHARED_MUTEX_HPP_
SharedMutexScope(SharedMutex *mutex, bool lock_initially=true)
bool timedlock(uint64_t timeout_nanosec)
Try lock up to the given timeout.
void initialize(bool recursive=false)
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
pthread_mutex_t * get_raw_mutex()
bool is_locked_by_me() const
A mutex that can be placed in shared memory and used from multiple processes.
SharedMutex * get_mutex() const
bool trylock()
Instantaneously try the lock.
void lock()
Unconditionally lock.
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
Auto-lock scope object for SharedMutex.
#define CXX11_FUNC_DELETE
Used in public headers in place of " = delete" of C++11.
bool is_recursive() const
bool is_initialized() const