]> sourceware.org Git - glibc.git/commit
nptl: Fix PTHREAD_PRIO_PROTECT timed lock
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 25 Nov 2020 20:15:51 +0000 (17:15 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 27 Nov 2020 12:59:13 +0000 (09:59 -0300)
commit71eeae0325a95f5e5d7ec4a27a6a6c357e0c8ef4
tree470fe6a8c1ab863ad0c400d6e19924c2d265ac68
parent9ff2674ef82eccd5ae5dfa6bb733c0e3613764c6
nptl: Fix PTHREAD_PRIO_PROTECT timed lock

The 878fe624d4 changed lll_futex_timed_wait, which expects a relative
timeout, with a __futex_abstimed_wait64, which expects an absolute
timeout.  However the code still passes a relative timeout.

Also, the PTHREAD_PRIO_PROTECT support for clocks different than
CLOCK_REALTIME was broken since the inclusion of
pthread_mutex_clocklock (9d20e22e46) since lll_futex_timed_wait
always use CLOCK_REALTIME.

This patch fixes by removing the relative time calculation.  It
also adds some xtests that tests both thread and inter-process
usage.

Checked on x86_64-linux-gnu.
nptl/Makefile
nptl/pthread_mutex_timedlock.c
nptl/tst-mutexpp5.c [new file with mode: 0644]
nptl/tst-mutexpp9.c [new file with mode: 0644]
sysdeps/pthread/tst-mutex5.c
sysdeps/pthread/tst-mutex9.c
This page took 0.041052 seconds and 5 git commands to generate.