This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Pass mutex member to pthread_mutex_unlock in __libc_lock_unlock_recursive


On Thu, Sep 26, 2013 at 02:07:55PM +0200, Andreas Schwab wrote:
> Siddhesh Poyarekar <siddhesh@redhat.com> writes:
> 
> > 	* nptl/sysdeps/pthread/bits/libc-lock.h [_LIBC &&
> > 	(!NOT_IN_libc || IS_IN_libpthread)]
> > 	(__libc_lock_unlock_recursive): Pass member mutex to
> > 	__pthread_mutex_unlock.
> 
> What about the other uses (__libc_lock_fini_recursive and
> __libc_lock_trylock_recursive)?

Oops, thanks, here's v2.  OK to commit this?

Siddhesh

	* nptl/sysdeps/pthread/bits/libc-lock.h [_LIBC &&
	(!NOT_IN_libc || IS_IN_libpthread)]
	(__libc_lock_fini_recursive): Pass member mutex to
	__pthread_mutex_unlock.
	(__libc_lock_trylock_recursive): Likewise.
	(__libc_lock_unlock_recursive): Likewise.


diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h
index b46bca9..0b95ab7 100644
--- a/nptl/sysdeps/pthread/bits/libc-lock.h
+++ b/nptl/sysdeps/pthread/bits/libc-lock.h
@@ -87,7 +87,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
 # define __libc_lock_fini_recursive(NAME) ((void) 0)
 #else
 # define __libc_lock_fini_recursive(NAME) \
-  __libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
+  __libc_maybe_call (__pthread_mutex_destroy, (&(NAME).mutex), 0)
 #endif
 
 /* Lock the recursive named lock variable.  */
@@ -129,7 +129,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
   })
 #else
 # define __libc_lock_trylock_recursive(NAME) \
-  __libc_maybe_call (__pthread_mutex_trylock, (&(NAME)), 0)
+  __libc_maybe_call (__pthread_mutex_trylock, (&(NAME).mutex), 0)
 #endif
 
 /* Unlock the recursive named lock variable.  */
@@ -145,7 +145,7 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
   } while (0)
 #else
 # define __libc_lock_unlock_recursive(NAME) \
-  __libc_maybe_call (__pthread_mutex_unlock, (&(NAME)), 0)
+  __libc_maybe_call (__pthread_mutex_unlock, (&(NAME).mutex), 0)
 #endif
 
 /* Note that for I/O cleanup handling we are using the old-style


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]