Lines Matching refs:lock
45 pthread_mutex_t lock; member
58 CRITICAL_SECTION lock; member
87 static __inline__ void mutex_lock(mutex_t* lock) in mutex_lock() argument
89 pthread_mutex_lock(lock); in mutex_lock()
91 static __inline__ void mutex_unlock(mutex_t* lock) in mutex_unlock() argument
93 pthread_mutex_unlock(lock); in mutex_unlock()
95 static __inline__ int mutex_init(mutex_t* lock) in mutex_init() argument
97 return pthread_mutex_init(lock, NULL); in mutex_init()
99 static __inline__ void mutex_destroy(mutex_t* lock) in mutex_destroy() argument
101 pthread_mutex_destroy(lock); in mutex_destroy()
108 CRITICAL_SECTION lock[1]; member
113 static __inline__ void mutex_lock(mutex_t* lock) in mutex_lock() argument
115 if (!lock->init) { in mutex_lock()
116 lock->init = 1; in mutex_lock()
117 InitializeCriticalSection( lock->lock ); in mutex_lock()
118 lock->init = 2; in mutex_lock()
119 } else while (lock->init != 2) in mutex_lock()
122 EnterCriticalSection(lock->lock); in mutex_lock()
125 static __inline__ void mutex_unlock(mutex_t* lock) in mutex_unlock() argument
127 LeaveCriticalSection(lock->lock); in mutex_unlock()
129 static __inline__ int mutex_init(mutex_t* lock) in mutex_init() argument
131 InitializeCriticalSection(lock->lock); in mutex_init()
132 lock->init = 2; in mutex_init()
135 static __inline__ void mutex_destroy(mutex_t* lock) in mutex_destroy() argument
137 if (lock->init) { in mutex_destroy()
138 lock->init = 0; in mutex_destroy()
139 DeleteCriticalSection(lock->lock); in mutex_destroy()