diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-12-09 22:07:28 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-12-09 22:10:38 -0700 |
| commit | 3e618f8432533eaa1cf6dcb39bdcb1b2e5bc1e47 (patch) | |
| tree | be4d87aea477a27bfb5d32d069df2dbee067407b /lib/std/bounded_array.zig | |
| parent | fdbb329d1009b4c7b23552e65c0344e3ce52b459 (diff) | |
| download | zig-3e618f8432533eaa1cf6dcb39bdcb1b2e5bc1e47.tar.gz zig-3e618f8432533eaa1cf6dcb39bdcb1b2e5bc1e47.zip | |
Cache: use mutex to protect recent_problematic_timestamp
The previous commit tried to use atomics but not many CPUs support
128-bit atomics. So we use a mutex. In order to avoid contention, we
also store `recent_problematic_timestamp` locally on the `Manifest`
which is only ever accessed from a single thread at a time, and only
consult the global one if the local one is problematic.
This commit was tested by running `zig build test-behavior` in two
separate terminals at the same time.
Diffstat (limited to 'lib/std/bounded_array.zig')
0 files changed, 0 insertions, 0 deletions
