1 #ifndef LIBFILEZILLA_MUTEX_HEADER
2 #define LIBFILEZILLA_MUTEX_HEADER
11 #include "glue/windows.hpp"
27 class FZ_PUBLIC_SYMBOL
mutex final
30 explicit mutex(
bool recursive =
true);
71 EnterCriticalSection(m_);
73 pthread_mutex_lock(m_);
81 LeaveCriticalSection(m_);
83 pthread_mutex_unlock(m_);
105 locked_ = op.locked_;
119 EnterCriticalSection(m_);
121 pthread_mutex_lock(m_);
133 LeaveCriticalSection(m_);
135 pthread_mutex_unlock(m_);
143 CRITICAL_SECTION * m_;
145 pthread_mutex_t * m_;
205 CONDITION_VARIABLE cond_;
207 pthread_cond_t cond_;
Waitable condition variable.
Definition: mutex.hpp:155
void wait(scoped_lock &l)
Wait indefinitely for condition to become signalled.
bool wait(scoped_lock &l, duration const &timeout)
Wait until timeout for condition to become signalled.
bool signalled(scoped_lock const &) const
Check if condition is already signalled.
Definition: mutex.hpp:202
void signal(scoped_lock &l)
Signal condition variable.
The duration class represents a time interval in milliseconds.
Definition: time.hpp:286
Lean replacement for std::(recursive_)mutex.
Definition: mutex.hpp:28
void unlock()
Beware, manual locking isn't exception safe, use scoped_lock.
bool try_lock()
Beware, manual locking isn't exception safe.
void lock()
Beware, manual locking isn't exception safe, use scoped_lock.
A simple scoped lock.
Definition: mutex.hpp:65
void unlock()
Releases the mutex.
Definition: mutex.hpp:129
void lock()
Obtains the mutex.
Definition: mutex.hpp:115
Sets some global macros and further includes string.hpp.
The namespace used by libfilezilla.
Definition: apply.hpp:17
Assorted classes dealing with time.