diff options
author | Ben Gamari <ben@well-typed.com> | 2021-11-30 18:51:18 +0000 |
---|---|---|
committer | Ben Gamari <ben@well-typed.com> | 2021-11-30 18:51:18 +0000 |
commit | 50fa4029c57bedaed7f64fcad0879e6df5c290b0 (patch) | |
tree | f8229cb1462f45414bb4078f612dd18067b2d8ab | |
parent | 9345bfeda8f463d3fc79054166cb90fe89ea3469 (diff) | |
download | haskell-wip/T20690.tar.gz |
rts: Annotate benign race in pthread ticker's exit test
wip/T20690
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)); |