summaryrefslogtreecommitdiff
path: root/linuxthreads/sysdeps/pthread/bits/libc-lock.h
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2001-08-24 03:25:40 +0000
committerRoland McGrath <roland@gnu.org>2001-08-24 03:25:40 +0000
commitedb6388469813ba6f4df742ae6dd55466a28976c (patch)
treeb9e14a3e16f52fb9cb5ee34878b85f1ee8a009ec /linuxthreads/sysdeps/pthread/bits/libc-lock.h
parent0dce3d154c4af198a042bd2d1fd9241e6890a9b2 (diff)
downloadglibc-edb6388469813ba6f4df742ae6dd55466a28976c.tar.gz
* sysdeps/generic/bits/libc-lock.h: Same changes.
Diffstat (limited to 'linuxthreads/sysdeps/pthread/bits/libc-lock.h')
-rw-r--r--linuxthreads/sysdeps/pthread/bits/libc-lock.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/linuxthreads/sysdeps/pthread/bits/libc-lock.h b/linuxthreads/sysdeps/pthread/bits/libc-lock.h
index fc68979aab..866e89d510 100644
--- a/linuxthreads/sysdeps/pthread/bits/libc-lock.h
+++ b/linuxthreads/sysdeps/pthread/bits/libc-lock.h
@@ -72,8 +72,10 @@ typedef pthread_key_t __libc_key_t;
/* Define an initialized recursive lock variable NAME with storage
class CLASS. */
-#define __libc_lock_define_initialized_recursive(CLS,NAME) \
- CLS __libc_lock_recursive_t NAME = {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP};
+#define __libc_lock_define_initialized_recursive(CLASS,NAME) \
+ CLASS __libc_lock_recursive_t NAME = _LIBC_LOCK_RECURSIVE_INITIALIZER;
+#define _LIBC_LOCK_RECURSIVE_INITIALIZER \
+ {PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP}
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
@@ -164,9 +166,9 @@ typedef pthread_key_t __libc_key_t;
/* Start critical region with cleanup. */
-#define __libc_cleanup_region_start(FCT, ARG) \
+#define __libc_cleanup_region_start(DOIT, FCT, ARG) \
{ struct _pthread_cleanup_buffer _buffer; \
- int _avail = _pthread_cleanup_push_defer != NULL; \
+ int _avail = (DOIT) && _pthread_cleanup_push_defer != NULL; \
if (_avail) { \
_pthread_cleanup_push_defer (&_buffer, (FCT), (ARG)); \
}