From 09efc3ba1269f79b78ee0724501fc762c2d5ab49 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sun, 8 Dec 2002 03:13:06 +0000 Subject: Update. 2002-12-07 Ulrich Drepper * sysdeps/generic/bits/stdio-lock.h (_IO_lock_trylock): New define. --- nptl/sysdeps/pthread/bits/libc-lock.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'nptl/sysdeps/pthread/bits/libc-lock.h') diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h index 30e3410cbc..cb2154956b 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) -- cgit v1.2.3