Home | History | Annotate | Download | only in glthread

Lines Matching refs:LOCK

30      Taking the lock:     gl_lock_lock (name);
31 Releasing the lock: gl_lock_unlock (name);
35 Taking the lock: err = glthread_lock_lock (&name);
36 Releasing the lock: err = glthread_lock_unlock (&name);
44 Taking the lock: gl_rwlock_rdlock (name);
46 Releasing the lock: gl_rwlock_unlock (name);
50 Taking the lock: err = glthread_rwlock_rdlock (&name);
52 Releasing the lock: err = glthread_rwlock_unlock (&name);
60 Taking the lock: gl_recursive_lock_lock (name);
61 Releasing the lock: gl_recursive_lock_unlock (name);
65 Taking the lock: err = glthread_recursive_lock_lock (&name);
66 Releasing the lock: err = glthread_recursive_lock_unlock (&name);
168 # define glthread_lock_init(LOCK) \
169 (pthread_in_use () ? pthread_mutex_init (LOCK, NULL) : 0)
170 # define glthread_lock_lock(LOCK) \
171 (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
172 # define glthread_lock_unlock(LOCK) \
173 (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
174 # define glthread_lock_destroy(LOCK) \
175 (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
190 # define glthread_rwlock_init(LOCK) \
191 (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
192 # define glthread_rwlock_rdlock(LOCK) \
193 (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
194 # define glthread_rwlock_wrlock(LOCK) \
195 (pthread_in_use () ? pthread_rwlock_wrlock (LOCK) : 0)
196 # define glthread_rwlock_unlock(LOCK) \
197 (pthread_in_use () ? pthread_rwlock_unlock (LOCK) : 0)
198 # define glthread_rwlock_destroy(LOCK) \
199 (pthread_in_use () ? pthread_rwlock_destroy (LOCK) : 0)
207 pthread_rwlock_t rwlock; /* read-write lock */
216 # define glthread_rwlock_init(LOCK) \
217 (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
218 # define glthread_rwlock_rdlock(LOCK) \
219 (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
220 # define glthread_rwlock_wrlock(LOCK) \
221 (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
222 # define glthread_rwlock_unlock(LOCK) \
223 (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
224 # define glthread_rwlock_destroy(LOCK) \
225 (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
226 extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
227 extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
228 extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
229 extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
230 extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
238 pthread_mutex_t lock; /* protects the remaining fields */
251 # define glthread_rwlock_init(LOCK) \
252 (pthread_in_use () ? glthread_rwlock_init_multithreaded (LOCK) : 0)
253 # define glthread_rwlock_rdlock(LOCK) \
254 (pthread_in_use () ? glthread_rwlock_rdlock_multithreaded (LOCK) : 0)
255 # define glthread_rwlock_wrlock(LOCK) \
256 (pthread_in_use () ? glthread_rwlock_wrlock_multithreaded (LOCK) : 0)
257 # define glthread_rwlock_unlock(LOCK) \
258 (pthread_in_use () ? glthread_rwlock_unlock_multithreaded (LOCK) : 0)
259 # define glthread_rwlock_destroy(LOCK) \
260 (pthread_in_use () ? glthread_rwlock_destroy_multithreaded (LOCK) : 0)
261 extern int glthread_rwlock_init_multithreaded (gl_rwlock_t *lock);
262 extern int glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock);
263 extern int glthread_rwlock_wrlock_multithreaded (gl_rwlock_t *lock);
264 extern int glthread_rwlock_unlock_multithreaded (gl_rwlock_t *lock);
265 extern int glthread_rwlock_destroy_multithreaded (gl_rwlock_t *lock);
287 # define glthread_recursive_lock_init(LOCK) \
288 (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
289 # define glthread_recursive_lock_lock(LOCK) \
290 (pthread_in_use () ? pthread_mutex_lock (LOCK) : 0)
291 # define glthread_recursive_lock_unlock(LOCK) \
292 (pthread_in_use () ? pthread_mutex_unlock (LOCK) : 0)
293 # define glthread_recursive_lock_destroy(LOCK) \
294 (pthread_in_use () ? pthread_mutex_destroy (LOCK) : 0)
295 extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
312 # define glthread_recursive_lock_init(LOCK) \
313 (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
314 # define glthread_recursive_lock_lock(LOCK) \
315 (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
316 # define glthread_recursive_lock_unlock(LOCK) \
317 (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
318 # define glthread_recursive_lock_destroy(LOCK) \
319 (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
320 extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
321 extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
322 extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
323 extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
345 # define glthread_recursive_lock_init(LOCK) \
346 (pthread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
347 # define glthread_recursive_lock_lock(LOCK) \
348 (pthread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
349 # define glthread_recursive_lock_unlock(LOCK) \
350 (pthread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
351 # define glthread_recursive_lock_destroy(LOCK) \
352 (pthread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
353 extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
354 extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
355 extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
356 extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
419 # define glthread_lock_init(LOCK) \
420 (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
421 # define glthread_lock_lock(LOCK) \
422 (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
423 # define glthread_lock_unlock(LOCK) \
424 (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
425 # define glthread_lock_destroy(LOCK) \
426 ((void)(LOCK), 0)
437 # define glthread_rwlock_init(LOCK) \
438 (pth_in_use () && !pth_rwlock_init (LOCK) ? errno : 0)
439 # define glthread_rwlock_rdlock(LOCK) \
440 (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0)
441 # define glthread_rwlock_wrlock(LOCK) \
442 (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0)
443 # define glthread_rwlock_unlock(LOCK) \
444 (pth_in_use () && !pth_rwlock_release (LOCK) ? errno : 0)
445 # define glthread_rwlock_destroy(LOCK) \
446 ((void)(LOCK), 0)
458 # define glthread_recursive_lock_init(LOCK) \
459 (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
460 # define glthread_recursive_lock_lock(LOCK) \
461 (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
462 # define glthread_recursive_lock_unlock(LOCK) \
463 (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
464 # define glthread_recursive_lock_destroy(LOCK) \
465 ((void)(LOCK), 0)
531 # define glthread_lock_init(LOCK) \
532 (thread_in_use () ? mutex_init (LOCK, USYNC_THREAD, NULL) : 0)
533 # define glthread_lock_lock(LOCK) \
534 (thread_in_use () ? mutex_lock (LOCK) : 0)
535 # define glthread_lock_unlock(LOCK) \
536 (thread_in_use () ? mutex_unlock (LOCK) : 0)
537 # define glthread_lock_destroy(LOCK) \
538 (thread_in_use () ? mutex_destroy (LOCK) : 0)
549 # define glthread_rwlock_init(LOCK) \
550 (thread_in_use () ? rwlock_init (LOCK, USYNC_THREAD, NULL) : 0)
551 # define glthread_rwlock_rdlock(LOCK) \
552 (thread_in_use () ? rw_rdlock (LOCK) : 0)
553 # define glthread_rwlock_wrlock(LOCK) \
554 (thread_in_use () ? rw_wrlock (LOCK) : 0)
555 # define glthread_rwlock_unlock(LOCK) \
556 (thread_in_use () ? rw_unlock (LOCK) : 0)
557 # define glthread_rwlock_destroy(LOCK) \
558 (thread_in_use () ? rwlock_destroy (LOCK) : 0)
578 # define glthread_recursive_lock_init(LOCK) \
579 (thread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
580 # define glthread_recursive_lock_lock(LOCK) \
581 (thread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
582 # define glthread_recursive_lock_unlock(LOCK) \
583 (thread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
584 # define glthread_recursive_lock_destroy(LOCK) \
585 (thread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
586 extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
587 extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
588 extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
589 extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
643 CRITICAL_SECTION lock;
652 # define glthread_lock_init(LOCK) \
653 (glthread_lock_init_func (LOCK), 0)
654 # define glthread_lock_lock(LOCK) \
655 glthread_lock_lock_func (LOCK)
656 # define glthread_lock_unlock(LOCK) \
657 glthread_lock_unlock_func (LOCK)
658 # define glthread_lock_destroy(LOCK) \
659 glthread_lock_destroy_func (LOCK)
660 extern void glthread_lock_init_func (gl_lock_t *lock);
661 extern int glthread_lock_lock_func (gl_lock_t *lock);
662 extern int glthread_lock_unlock_func (gl_lock_t *lock);
663 extern int glthread_lock_destroy_func (gl_lock_t *lock);
682 CRITICAL_SECTION lock; /* protects the remaining fields */
694 # define glthread_rwlock_init(LOCK) \
695 (glthread_rwlock_init_func (LOCK), 0)
696 # define glthread_rwlock_rdlock(LOCK) \
697 glthread_rwlock_rdlock_func (LOCK)
698 # define glthread_rwlock_wrlock(LOCK) \
699 glthread_rwlock_wrlock_func (LOCK)
700 # define glthread_rwlock_unlock(LOCK) \
701 glthread_rwlock_unlock_func (LOCK)
702 # define glthread_rwlock_destroy(LOCK) \
703 glthread_rwlock_destroy_func (LOCK)
704 extern void glthread_rwlock_init_func (gl_rwlock_t *lock);
705 extern int glthread_rwlock_rdlock_func (gl_rwlock_t *lock);
706 extern int glthread_rwlock_wrlock_func (gl_rwlock_t *lock);
707 extern int glthread_rwlock_unlock_func (gl_rwlock_t *lock);
708 extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock);
713 implements a recursive lock. But we need not rely on it: It's easy to
714 implement a recursive lock without this assumption. */
721 CRITICAL_SECTION lock;
730 # define glthread_recursive_lock_init(LOCK) \
731 (glthread_recursive_lock_init_func (LOCK), 0)
732 # define glthread_recursive_lock_lock(LOCK) \
733 glthread_recursive_lock_lock_func (LOCK)
734 # define glthread_recursive_lock_unlock(LOCK) \
735 glthread_recursive_lock_unlock_func (LOCK)
736 # define glthread_recursive_lock_destroy(LOCK) \
737 glthread_recursive_lock_destroy_func (LOCK)
738 extern void glthread_recursive_lock_init_func (gl_recursive_lock_t *lock);
739 extern int glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock);
740 extern int glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock);
741 extern int glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock);
749 CRITICAL_SECTION lock;