mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-21 01:12:26 +08:00
389fdf78b2
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). |
||
---|---|---|
.. | ||
sys | ||
aio_misc.h | ||
allocrtsig.c | ||
fork.c | ||
fork.h | ||
futex-internal.h | ||
gai_misc.h | ||
Implies | ||
internaltypes.h | ||
jmp-unwind.c | ||
libc-lock.h | ||
libc-lockP.h | ||
librt-cancellation.c | ||
lowlevellock-futex.h | ||
lowlevellock.h | ||
Makeconfig | ||
Makefile | ||
malloc-machine.h | ||
nptl-signals.h | ||
pthread-functions.h | ||
pthread.h | ||
setxid.h | ||
shm-directory.h | ||
sigfillset.c | ||
stdio-lock.h | ||
Subdirs | ||
tcb-offsets.h | ||
tst-mqueue8x.c | ||
unwind-forcedunwind.c |