1 #ifndef __JLANG__JMUTEX__
2 #define __JLANG__JMUTEX__
12 namespace JSYNCHRONIZATION {}
13 namespace JPP {
using namespace JSYNCHRONIZATION; }
15 namespace JSYNCHRONIZATION {
46 template<
typename Lockable>
106 pthread_mutex_init(&
m_mutex, 0);
114 pthread_mutex_destroy(&
m_mutex);
124 return pthread_mutex_lock(&
m_mutex);
134 return pthread_mutex_trylock(&
m_mutex);
144 return pthread_mutex_unlock(&
m_mutex);
152 #endif // __JLANG__JMUTEX__
JBasicScopedLock< JMutex > JScopedLock
JBasicScopedLock operator=(const JBasicScopedLock &)
int lock()
Lock the mutex.
int unlock()
Unlock the mutex.
JBasicScopedLock(const JBasicScopedLock &)
Neither copy-constructible nor copy-assignable.
int unlock()
Unlock the mutex.
JBasicScopedLock(Lockable &lock)
Constructor.
~JBasicScopedLock()
Destructor.
int try_lock()
Try lock the mutex.