]> git.ipfire.org Git - thirdparty/glibc.git/commit
nptl: Add CLOCK_MONOTONIC support for PI mutexes
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 11 Aug 2021 18:17:41 +0000 (18:17 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 1 Oct 2021 13:11:11 +0000 (10:11 -0300)
commit2313ab153de29849f8fb0817ed3789fa1745225a
tree00bb8f53d537de33fb4c8ab831daaaf0563798c8
parent9cba3fa34b15017b269f2674ce7656bbc9d4d06d
nptl: Add CLOCK_MONOTONIC support for PI mutexes

Linux added FUTEX_LOCK_PI2 to support clock selection
(commit bf22a6976897977b0a3f1aeba6823c959fc4fdae).  With the new
flag we can now proper support CLOCK_MONOTONIC for
pthread_mutex_clocklock with Priority Inheritance.  If kernel
does not support, EINVAL is returned instead.

The difference is the futex operation will be issued and the kernel
will advertise the missing support (instead of hard-code error
return).

Checked on x86_64-linux-gnu and i686-linux-gnu on Linux 5.14, 5.11,
and 4.15.
nptl/pthread_mutex_timedlock.c
nptl/tst-mutexpi10.c
sysdeps/pthread/tst-mutex5.c
sysdeps/pthread/tst-mutex9.c