This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] Pass mutex member to pthread_mutex_unlock in __libc_lock_unlock_recursive
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 26 Sep 2013 17:16:05 +0530
- Subject: [PATCH] Pass mutex member to pthread_mutex_unlock in __libc_lock_unlock_recursive
- Authentication-results: sourceware.org; auth=none
Hi,
Currently, the definition of macro __libc_lock_unlock_recursive passes
the __libc_lock_recursive_t to pthread_mutex_unlock instead of the
member mutex, which looks like a typo. The patch below fixes this. I
am working on a change that uses this macro and have verified that the
build warning resulting from this was fixed.
Also verified on x86_64 that there are no regressions in the
testsuite. OK to commit?
Siddhesh
* 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.
diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h
index b46bca9..12014df 100644
--- a/nptl/sysdeps/pthread/bits/libc-lock.h
+++ b/nptl/sysdeps/pthread/bits/libc-lock.h
@@ -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