diff options
author | Carlos O'Donell <carlos@systemhalted.org> | 2015-01-21 00:46:16 -0500 |
---|---|---|
committer | Carlos O'Donell <carlos@systemhalted.org> | 2015-01-21 00:46:16 -0500 |
commit | 042e1521c794a945edc43b5bfa7e69ad70420524 (patch) | |
tree | 74f44d4b065d801cfe6ace654827ca8ef351bff8 /ChangeLog | |
parent | a8db092ec0c6742a9d41e1715946e90d4edfeec1 (diff) | |
download | glibc-042e1521c794a945edc43b5bfa7e69ad70420524.tar glibc-042e1521c794a945edc43b5bfa7e69ad70420524.tar.gz glibc-042e1521c794a945edc43b5bfa7e69ad70420524.tar.bz2 glibc-042e1521c794a945edc43b5bfa7e69ad70420524.zip |
Fix semaphore destruction (bug 12674).
This commit fixes semaphore destruction by either using 64b atomic
operations (where available), or by using two separate fields when only
32b atomic operations are available. In the latter case, we keep a
conservative estimate of whether there are any waiting threads in one
bit of the field that counts the number of available tokens, thus
allowing sem_post to atomically both add a token and determine whether
it needs to call futex_wake.
See:
https://sourceware.org/ml/libc-alpha/2014-12/msg00155.html
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 52 |
1 files changed, 52 insertions, 0 deletions
@@ -1,3 +1,55 @@ +2015-01-21 Torvald Riegel <triegel@redhat.com> + Carlos O'Donell <carlos@redhat.com> + + [BZ #12674] + * nptl/sem_waitcommon.c: New file. + * nptl/sem_wait.c: Include sem_waitcommon.c. + (__sem_wait_cleanup, do_futex_wait): Remove. + (__new_sem_wait): Adapt. + (__new_sem_trywait): New function. + (__old_sem_trywait): Moved here from nptl/sem_trywait.c. + * nptl/sem_timedwait.c: Include sem_waitcommon.c. + (__sem_wait_cleanup, do_futex_timed_wait): Remove. + (sem_timedwait): Adapt. + * nptl/sem_post.c (__new_sem_post): Adapt. + (futex_wake): New function. + (__old_sem_post): Add release MO fence. + * nptl/sem_open.c (sem_open): Adapt. + * nptl/sem_init.c (__new_sem_init): Adapt. + (futex_private_if_supported): New function. + * nptl/sem_getvalue.c (__new_sem_getvalue): Adapt. + (__old_sem_getvalue): Add using previous code. + * sysdeps/nptl/internaltypes.h: Adapt. + * nptl/tst-sem13.c (do_test): Adapt. + * nptl/tst-sem11.c (main): Adapt. + * nptl/sem_trywait.c: Remove. + * nptl/DESIGN-sem.txt: Remove. + * nptl/Makefile (libpthread-routines): Remove sem_trywait. + (gen-as-const-headers): Remove structsem.sym. + * nptl/structsem.sym: Remove. + * sysdeps/unix/sysv/linux/alpha/sem_post.c: Remove. + * sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Remove. + * sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Remove. + * sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Remove. + * sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Remove. + * sysdeps/unix/sysv/linux/i386/i586/sem_post.S: Remove. + * sysdeps/unix/sysv/linux/i386/i586/sem_timedwait.S: Remove. + * sysdeps/unix/sysv/linux/i386/i586/sem_trywait.S: Remove. + * sysdeps/unix/sysv/linux/i386/i586/sem_wait.S: Remove. + * sysdeps/unix/sysv/linux/i386/i686/sem_post.S: Remove. + * sysdeps/unix/sysv/linux/i386/i686/sem_timedwait.S: Remove. + * sysdeps/unix/sysv/linux/i386/i686/sem_trywait.S: Remove. + * sysdeps/unix/sysv/linux/i386/i686/sem_wait.S: Remove. + * sysdeps/unix/sysv/linux/powerpc/sem_post.c: Remove. + * sysdeps/unix/sysv/linux/sh/sem_post.S: Remove. + * sysdeps/unix/sysv/linux/sh/sem_timedwait.S: Remove. + * sysdeps/unix/sysv/linux/sh/sem_trywait.S: Remove. + * sysdeps/unix/sysv/linux/sh/sem_wait.S: Remove. + * sysdeps/unix/sysv/linux/x86_64/sem_post.S: Remove. + * sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S: Remove. + * sysdeps/unix/sysv/linux/x86_64/sem_trywait.S: Remove. + * sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Remove. + 2015-01-20 Carlos O'Donell <carlos@redhat.com> * INSTALL: Regenerated. |