/* Locking in multithreaded situations.
- Copyright (C) 2005-2007 Free Software Foundation, Inc.
+ Copyright (C) 2005-2008 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
# endif
# define gl_recursive_lock_init(NAME) \
- do \
- { \
- if (pthread_in_use () && pthread_mutex_init (&NAME, NULL) != 0) \
- abort (); \
- } \
+ do \
+ { \
+ if (pthread_in_use ()) \
+ glthread_recursive_lock_init (&NAME); \
+ } \
while (0)
# define gl_recursive_lock_lock(NAME) \
do \
abort (); \
} \
while (0)
+extern void glthread_recursive_lock_init (gl_recursive_lock_t *lock);
# else
# define gl_lock_init(NAME)
# define gl_lock_lock(NAME)
# define gl_lock_unlock(NAME)
+# define gl_lock_destroy(NAME)
/* ------------------------- gl_rwlock_t datatype ------------------------- */
# define gl_rwlock_rdlock(NAME)
# define gl_rwlock_wrlock(NAME)
# define gl_rwlock_unlock(NAME)
+# define gl_rwlock_destroy(NAME)
/* --------------------- gl_recursive_lock_t datatype --------------------- */
# define gl_recursive_lock_init(NAME)
# define gl_recursive_lock_lock(NAME)
# define gl_recursive_lock_unlock(NAME)
+# define gl_recursive_lock_destroy(NAME)
/* -------------------------- gl_once_t datatype -------------------------- */