diff options
author | Ulrich Drepper <drepper@redhat.com> | 2002-12-08 03:13:06 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2002-12-08 03:13:06 +0000 |
commit | 09efc3ba1269f79b78ee0724501fc762c2d5ab49 (patch) | |
tree | 840ca5c526b221f3510f23b1f17c9e379b84129f /nptl/sysdeps/pthread/bits/libc-lock.h | |
parent | 6ccb3834ebf1cb65d180144442a68cd1c24f1dd5 (diff) | |
download | glibc-09efc3ba1269f79b78ee0724501fc762c2d5ab49.zip glibc-09efc3ba1269f79b78ee0724501fc762c2d5ab49.tar.gz glibc-09efc3ba1269f79b78ee0724501fc762c2d5ab49.tar.bz2 |
Update.
2002-12-07 Ulrich Drepper <drepper@redhat.com>
* sysdeps/generic/bits/stdio-lock.h (_IO_lock_trylock): New define.
Diffstat (limited to 'nptl/sysdeps/pthread/bits/libc-lock.h')
-rw-r--r-- | nptl/sysdeps/pthread/bits/libc-lock.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h index 30e3410..cb21549 100644 --- a/nptl/sysdeps/pthread/bits/libc-lock.h +++ b/nptl/sysdeps/pthread/bits/libc-lock.h @@ -1,4 +1,4 @@ -/* libc-internal interface for mutex locks. LinuxThreads version. +/* libc-internal interface for mutex locks. NPTL version. Copyright (C) 1996-2001, 2002 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -254,8 +254,8 @@ typedef pthread_key_t __libc_key_t; /* Try to lock the recursive named lock variable. */ #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread) -# define __libc_lock_trylock_recursive(NAME) \ - do { \ +# define __libc_lock_trylock_recursive(NAME) \ + ({ \ int result = 0; \ void *self = THREAD_SELF; \ if ((NAME).owner != self) \ @@ -270,7 +270,8 @@ typedef pthread_key_t __libc_key_t; } \ else \ ++(NAME).cnt; \ - } while (0) + result; \ + }) #else # define __libc_lock_trylock_recursive(NAME) \ __libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0) |