mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 21:44:16 +00:00
59fe124c40
The mutex was being locked from the very start, before it was needed and possibly before it would be needed. Also rename the static global to stick to rust naming conventions. Note that `once_cell::sync::Lazy<T>` actually internally uses its own lock around the value, but in this case it's insufficient because `SmallRng` doesn't implement `SeedableRng` so we can't reseed it with only an `&mut` reference and must instead replace its value. We probably *could* still use `Lazy<SmallRng>` directly and then rely on `std::mem::swap()` to replace the contents of the shared global static without reassigning the variable directly with a new `SmallRng` instance, but I'm not sure that's a great idea. This is just a built-in, there's no real harm in locking twice (especially while fish remains essentially single-threaded). |
||
---|---|---|
.. | ||
src | ||
widestring-suffix | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml |