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] | |
The attached patch somwhat improved documentation of the non-elision cases of pthread_mutex_lock and pthread_mutex_trylock. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany
>From f8a0d78c2db32189e31f505e274809d6807cdae0 Mon Sep 17 00:00:00 2001
From: Dominik Vogt <vogt@de.ibm.com>
Date: Wed, 18 Sep 2013 06:09:36 +0000
Subject: [PATCH 1/7] x86: Improve comments in elision-(try)lock.c
---
nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c | 3 ++-
nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c b/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c
index 9d00983..7854057 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c
+++ b/nptl/sysdeps/unix/sysv/linux/x86/elision-lock.c
@@ -86,7 +86,8 @@ __lll_lock_elision (int *futex, short *adapt_count, EXTRAARG int private)
else
{
/* Use a normal lock until the threshold counter runs out.
- Lost updates possible. */
+ Lost updates possible. Due to races this might lead
+ to *adapt_count becoming less than zero. */
(*adapt_count)--;
}
diff --git a/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c b/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c
index f6c47ef..1b6c91e 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c
+++ b/nptl/sysdeps/unix/sysv/linux/x86/elision-trylock.c
@@ -63,7 +63,8 @@ __lll_trylock_elision (int *futex, short *adapt_count)
}
else
{
- /* Lost updates are possible, but harmless. */
+ /* Lost updates possible, but harmless. Due to races this
+ might lead to *adapt_count becoming less than zero. */
(*adapt_count)--;
}
--
1.7.11.4
Attachment:
ChangeLog
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |