You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### What does this PR try to resolve?
By making `GlobalContext` `Sync`, it will become much easier to
parallelize parts of cargo. A concrete example is #15676.
It was my understanding from
#15934 (comment)
that this would be a welcome change by the cargo team.
#### Overview
In `GlobalContext` and structs used in its fields
- `RefCell`-s were replaced by either an `std::sync::Mutex` or an
`std::sync::RwLock`, depending on API needs
- `LazyCell`-s were replaced by a new `OnceLock` implementation backed
by `std::sync::OnceLock`, emulating unstable features needed by cargo
- Removed `LazyCell`/`OnceLock` from fields where the initialization
function is just a `Mutex<HashMap>::default()`
- added `util::context::tests::sync_context` test that does not compile
if `GlobalContext` is not `Sync`
### How to test and review this PR?
This PR should add no user-facing changes. Tests must pass and
benchmarks must report no changes.
0 commit comments