10 singleLock(pthread_mutex_t &m )
13 pthread_mutex_lock(&lock);
17 pthread_mutex_unlock(&lock);
23 friend class eRdLocker;
24 friend class eWrLocker;
25 pthread_rwlock_t m_lock;
26 eRdWrLock(eRdWrLock &);
30 pthread_rwlock_init(&m_lock, 0);
34 pthread_rwlock_destroy(&m_lock);
38 pthread_rwlock_rdlock(&m_lock);
42 pthread_rwlock_wrlock(&m_lock);
46 pthread_rwlock_unlock(&m_lock);
54 eRdLocker(eRdWrLock &m)
57 pthread_rwlock_rdlock(&m_lock.m_lock);
61 pthread_rwlock_unlock(&m_lock.m_lock);
69 eWrLocker(eRdWrLock &m)
72 pthread_rwlock_wrlock(&m_lock.m_lock);
76 pthread_rwlock_unlock(&m_lock.m_lock);
82 friend class eSingleLocker;
83 pthread_mutex_t m_lock;
84 eSingleLock(eSingleLock &);
86 eSingleLock(bool recursive=false)
90 pthread_mutexattr_t attr;
91 pthread_mutexattr_init(&attr);
92 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
93 pthread_mutex_init(&m_lock, &attr);
94 pthread_mutexattr_destroy(&attr);
97 pthread_mutex_init(&m_lock, 0);
101 pthread_mutex_destroy(&m_lock);
109 eSingleLocker(eSingleLock &m)
112 pthread_mutex_lock(&m_lock.m_lock);
116 pthread_mutex_unlock(&m_lock.m_lock);
122 pthread_mutex_t mutex;
128 void lock(int res=100);
129 void unlock(int res=100);
140 eLocker(eLock &lock, int res=100);
147 pthread_mutex_t mutex;