]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
clock_gettime: Fix CLOCK_THREAD_CPUTIME_ID race
authorfirk <firk@cantconnect.ru>
Tue, 15 Mar 2022 22:22:21 +0000 (18:22 -0400)
committerMark Johnston <markj@FreeBSD.org>
Thu, 17 Mar 2022 19:39:00 +0000 (15:39 -0400)
commit28d08dc7d051a4e058cc0004cf4dd884f87037a2
tree5bd1c8a93b6eee3adcd2ba42d1ec9bb3e49d073a
parentfc7e121d88d65aabbb8ce87d8e1d13e3c3cf18eb
clock_gettime: Fix CLOCK_THREAD_CPUTIME_ID race

Use a spinlock section instead of a critical section to synchronize with
statclock().  Otherwise the CLOCK_THREAD_CPUTIME_ID clock can appear to
go backwards.

PR: 262273
Reviewed by: markj
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D34568
sys/kern/kern_time.c