aboutsummaryrefslogtreecommitdiff
path: root/lib/std/atomic
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-12-09 21:14:39 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-12-09 22:10:38 -0700
commitfdbb329d1009b4c7b23552e65c0344e3ce52b459 (patch)
treeba83854a4725344ffb9132589ca577b2f947a439 /lib/std/atomic
parent4da83feccb4b0e59afdcce9796b08cc4fc8346ae (diff)
downloadzig-fdbb329d1009b4c7b23552e65c0344e3ce52b459.tar.gz
zig-fdbb329d1009b4c7b23552e65c0344e3ce52b459.zip
Cache: fix data race with is_problematic_timestamp
Previously `recent_problematic_timestamp` was unprotected and accessed potentially with multiple worker threads simultaneously. This commit protects it with atomics and also introduces a flag to prevent multiple timestamp checks from within the same call to hit(). Unfortunately the compiler-rt function __sync_val_compare_and_swap_16 is not yet implemented, so I will have to take a different strategy in a follow-up commit.
Diffstat (limited to 'lib/std/atomic')
0 files changed, 0 insertions, 0 deletions