mirror of
https://github.com/rust-lang/cargo.git
synced 2025-09-28 11:20:36 +00:00

This introduces a new `CacheLocker` which manages locks on the package cache. Instead of either being "locked" or "not locked", the new locker supports multiple modes: - Shared lock: Cargo can read from the package sources, along with any other cargos reading at the same time. - Download exclusive lock: Only one cargo can perform downloads. Download locks do not interfere with Shared locks, since it is expected that downloading does not modify existing files (only adds new ones). - Mutate exclusive lock: Only one cargo can have this lock, and it also prevents shared locks. This is so that the cargo can modify the package cache (such as deleting files) without breaking concurrent processes.