about summary refs log tree commit diff
path: root/linuxthreads/sysdeps/pthread/bits/libc-lock.h
diff options
context:
space:
mode:
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));		      \
     }