diff options
author | Ben Gamari <ben@well-typed.com> | 2021-11-30 18:51:18 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-12-01 03:12:56 -0500 |
commit | f124f2a0ca3ba2b80839d8f107763ffe3b48b6e0 (patch) | |
tree | 6f9a9867fd7719f8264eb45431181d6b7bb95f14 | |
parent | b53f122749af4dec41e3b4fde4c4c3bfcd459982 (diff) | |
download | haskell-f124f2a0ca3ba2b80839d8f107763ffe3b48b6e0.tar.gz |
rts: Annotate benign race in pthread ticker's exit test
Previously TSAN would report spurious data races due to
the unsynchronized access of `exited`. I would have thought
that using a relaxed load on `exited` would be enough to convince
TSAN that the race was intentional, but apparently not.
Closes #20690.
-rw-r--r-- | rts/posix/ticker/Pthread.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rts/posix/ticker/Pthread.c b/rts/posix/ticker/Pthread.c index f07d000dac..7d39fd1b10 100644 --- a/rts/posix/ticker/Pthread.c +++ b/rts/posix/ticker/Pthread.c @@ -109,6 +109,7 @@ static void *itimer_thread_func(void *_handle_tick) // Relaxed is sufficient: If we don't see that exited was set in one iteration we will // see it next time. + TSAN_ANNOTATE_BENIGN_RACE(&exited, "itimer_thread_func"); while (!RELAXED_LOAD(&exited)) { if (USE_TIMERFD_FOR_ITIMER) { ssize_t r = read(timerfd, &nticks, sizeof(nticks)); |