This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 2.25] powerpc: Fix adapt_count update in __lll_unlock_elision
- From: "Tulio Magno Quites Machado Filho" <tuliom at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org, uweigand at de dot ibm dot com, schwab at linux-m68k dot org
- Cc: siddhesh at sourceware dot org
- Date: Mon, 16 Jan 2017 11:22:04 -0200
- Subject: [PATCH 2.25] powerpc: Fix adapt_count update in __lll_unlock_elision
- Authentication-results: sourceware.org; auth=none
- References: <87a8axa6rt.fsf@linux-m68k.org>
Thanks for catching this.
--- 8< ---
Commit e9a96ea1aca4ebaa7c86e8b83b766f118d689d0f had an error that
prevents adapt_count from being updated in __lll_unlock_elision.
2017-01-16 Tulio Magno Quites Machado Filho <tuliom@linux.vnet.ibm.com>
* sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
(__lll_unlock_elision): Fix adapt_count decrement.
---
sysdeps/unix/sysv/linux/powerpc/elision-unlock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
index 759c146..e3fe58e 100644
--- a/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
+++ b/sysdeps/unix/sysv/linux/powerpc/elision-unlock.c
@@ -35,7 +35,7 @@ __lll_unlock_elision (int *lock, short *adapt_count, int pshared)
the mutex destruction requirements. */
short __tmp = atomic_load_relaxed (adapt_count);
if (__tmp > 0)
- atomic_store_relaxed (adapt_count, __tmp--);
+ atomic_store_relaxed (adapt_count, __tmp - 1);
lll_unlock ((*lock), pshared);
}
--
2.1.0