Follow up on https://crrev.com/c/8498180 to consolidate file_lock and try_file_lock into a single context manager and replace per-entry <hash>.lock files with a global .deps_cache/.lock. Holding the global cache lock across cache usage/initialization and prune_cache also closes a TOCTOU race where prune_cache could evict an entry that a concurrent sync_dependencies started using after get_referenced_cache_hashes completed. TAG=agy R=olivf@chromium.org Bug: 569942997 Change-Id: Ic499c1970d34054c0d0ac68974622331849ea452 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/8512342 Reviewed-by: Olivier Flückiger <olivf@chromium.org> Commit-Queue: Clemens Backes <clemensb@chromium.org> Cr-Commit-Position: refs/heads/main@{#110351}