glibc/sysdeps/nptl
Torvald Riegel 389fdf78b2 Do not violate mutex destruction requirements.
POSIX and C++11 require that a thread can destroy a mutex if no other
thread owns the mutex, is blocked on the mutex, or will try to acquire
it in the future.  After destroying the mutex, it can reuse or unmap the
underlying memory.  Thus, we must not access a mutex' memory after
releasing it.  Currently, we can load the private flag after releasing
the mutex, which is fixed by this patch.
See https://sourceware.org/bugzilla/show_bug.cgi?id=13690 for more
background.

We need to call futex_wake on the lock after releasing it, however.  This
is by design, and can lead to spurious wake-ups on unrelated futex words
(e.g., when the mutex memory is reused for another mutex).  This behavior
is documented in the glibc-internal futex API and in recent drafts of the
Linux kernel's futex documentation (see the draft_futex branch of
git://git.kernel.org/pub/scm/docs/man-pages/man-pages.git).
2015-12-23 18:44:53 +01:00
..
sys Fix copyright year on new stub sys/procfs.h file. 2015-01-08 14:29:45 -08:00
aio_misc.h Add and use new glibc-internal futex API. 2015-07-10 13:47:09 +02:00
allocrtsig.c Include <signal.h> in sysdeps/nptl/allocrtsig.c 2015-01-29 10:00:25 +01:00
fork.c Rename bits/stdio-lock.h to stdio-lock.h (bug 14912). 2015-09-04 16:21:14 +00:00
fork.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
futex-internal.h Add and use new glibc-internal futex API. 2015-07-10 13:47:09 +02:00
gai_misc.h Add and use new glibc-internal futex API. 2015-07-10 13:47:09 +02:00
Implies Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
internaltypes.h Use uint64_t and (uint64_t) 1 for 64-bit int 2015-01-23 14:48:40 -08:00
jmp-unwind.c Use __libc_ptf_call in _longjmp_unwind 2015-09-18 12:22:47 -07:00
libc-lock.h Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912). 2015-09-08 21:11:03 +00:00
libc-lockP.h Replace MUTEX_INITIALIZER with _LIBC_LOCK_INITIALIZER in generic code 2015-11-24 16:37:15 +01:00
librt-cancellation.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
lowlevellock-futex.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
lowlevellock.h Do not violate mutex destruction requirements. 2015-12-23 18:44:53 +01:00
Makeconfig Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Makefile Remove sysdeps/nptl/configure.ac. 2015-10-27 21:46:03 +00:00
malloc-machine.h Replace MUTEX_INITIALIZER with _LIBC_LOCK_INITIALIZER in generic code 2015-11-24 16:37:15 +01:00
nptl-signals.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
pthread-functions.h Use __pthread_setcancelstate in libc.a 2015-09-17 16:38:54 -07:00
pthread.h NPTL: Remove duplicate definition of PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP 2015-03-28 01:50:12 -04:00
setxid.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
shm-directory.h Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
sigfillset.c Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
stdio-lock.h Move bits/libc-lock.h and bits/libc-lockP.h out of bits/ (bug 14912). 2015-09-08 21:11:03 +00:00
Subdirs Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
tcb-offsets.h Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
tst-mqueue8x.c Get rid of nptl/sysdeps/pthread/ subdirectory 2014-06-12 13:48:47 -07:00
unwind-forcedunwind.c ARM: Consolidate with generic unwinder wrapper code 2015-01-05 15:42:16 -08:00