diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-12-09 21:14:39 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-12-09 22:10:38 -0700 |
| commit | fdbb329d1009b4c7b23552e65c0344e3ce52b459 (patch) | |
| tree | ba83854a4725344ffb9132589ca577b2f947a439 /src/ThreadPool.zig | |
| parent | 4da83feccb4b0e59afdcce9796b08cc4fc8346ae (diff) | |
| download | zig-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 'src/ThreadPool.zig')
0 files changed, 0 insertions, 0 deletions
