aboutsummaryrefslogtreecommitdiff
path: root/lib/std/atomic/stack.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-12-09 22:07:28 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-12-09 22:10:38 -0700
commit3e618f8432533eaa1cf6dcb39bdcb1b2e5bc1e47 (patch)
treebe4d87aea477a27bfb5d32d069df2dbee067407b /lib/std/atomic/stack.zig
parentfdbb329d1009b4c7b23552e65c0344e3ce52b459 (diff)
downloadzig-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/atomic/stack.zig')
0 files changed, 0 insertions, 0 deletions