Lines Matching refs:name

44  *   _glthread_DECLARE_STATIC_MUTEX(name)   Declare a non-local mutex
45 * _glthread_INIT_MUTEX(name) Initialize a mutex
46 * _glthread_LOCK_MUTEX(name) Lock a mutex
47 * _glthread_UNLOCK_MUTEX(name) Unlock a mutex
104 #define _glthread_DECLARE_STATIC_MUTEX(name) \
105 static _glthread_Mutex name = PTHREAD_MUTEX_INITIALIZER
107 #define _glthread_INIT_MUTEX(name) \
108 pthread_mutex_init(&(name), NULL)
110 #define _glthread_DESTROY_MUTEX(name) \
111 pthread_mutex_destroy(&(name))
113 #define _glthread_LOCK_MUTEX(name) \
114 (void) pthread_mutex_lock(&(name))
116 #define _glthread_UNLOCK_MUTEX(name) \
117 (void) pthread_mutex_unlock(&(name))
144 #define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
145 #define _glthread_INIT_MUTEX(name) (void) name
146 #define _glthread_DESTROY_MUTEX(name) (void) name
147 #define _glthread_LOCK_MUTEX(name) (void) name
148 #define _glthread_UNLOCK_MUTEX(name) (void) name
172 #define _glthread_DECLARE_STATIC_MUTEX(name) /*static*/ _glthread_Mutex name = {0,0,0,0,0,0}
173 #define _glthread_INIT_MUTEX(name) InitializeCriticalSection(&name)
174 #define _glthread_DESTROY_MUTEX(name) DeleteCriticalSection(&name)
175 #define _glthread_LOCK_MUTEX(name) EnterCriticalSection(&name)
176 #define _glthread_UNLOCK_MUTEX(name) LeaveCriticalSection(&name)
200 #define _glthread_DECLARE_STATIC_MUTEX(name) \
201 static _glthread_Mutex name = XMUTEX_INITIALIZER
203 #define _glthread_DECLARE_STATIC_MUTEX(name) \
204 static _glthread_Mutex name
207 #define _glthread_INIT_MUTEX(name) \
208 xmutex_init(&(name))
210 #define _glthread_DESTROY_MUTEX(name) \
211 xmutex_clear(&(name))
213 #define _glthread_LOCK_MUTEX(name) \
214 (void) xmutex_lock(&(name))
216 #define _glthread_UNLOCK_MUTEX(name) \
217 (void) xmutex_unlock(&(name))
245 #define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = { 0, 0 }
246 #define _glthread_INIT_MUTEX(name) name.sem = create_sem(0, #name"_benaphore"), name.lock = 0
247 #define _glthread_DESTROY_MUTEX(name) delete_sem(name.sem), name.lock = 0
248 #define _glthread_LOCK_MUTEX(name) if (name.sem == 0) _glthread_INIT_MUTEX(name); \
249 if (atomic_add(&(name.lock), 1) >= 1) acquire_sem(name.sem)
250 #define _glthread_UNLOCK_MUTEX(name) if (atomic_add(&(name.lock), -1) > 1) release_sem(name.sem)
268 #define _glthread_DECLARE_STATIC_MUTEX(name) static _glthread_Mutex name = 0
270 #define _glthread_INIT_MUTEX(name) (void) name
272 #define _glthread_DESTROY_MUTEX(name) (void) name
274 #define _glthread_LOCK_MUTEX(name) (void) name
276 #define _glthread_UNLOCK_MUTEX(name) (void) name