From 71eeae0325a95f5e5d7ec4a27a6a6c357e0c8ef4 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 25 Nov 2020 17:15:51 -0300 Subject: 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/tst-mutexpp5.c | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 nptl/tst-mutexpp5.c (limited to 'nptl/tst-mutexpp5.c') diff --git a/nptl/tst-mutexpp5.c b/nptl/tst-mutexpp5.c new file mode 100644 index 0000000000..a864a390ca --- /dev/null +++ b/nptl/tst-mutexpp5.c @@ -0,0 +1,2 @@ +#define ENABLE_PP 1 +#include "tst-mutex5.c" -- cgit v1.2.3-70-g09d2