Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/uv-configuration/src/threading.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub static RAYON_PARALLELISM: AtomicUsize = AtomicUsize::new(0);
/// `LazyLock::force(&RAYON_INITIALIZE)`.
pub static RAYON_INITIALIZE: LazyLock<()> = LazyLock::new(|| {
rayon::ThreadPoolBuilder::new()
.num_threads(RAYON_PARALLELISM.load(Ordering::SeqCst))
.num_threads(RAYON_PARALLELISM.load(Ordering::Relaxed))
.stack_size(min_stack_size())
.build_global()
.expect("failed to initialize global rayon pool");
Expand Down
8 changes: 4 additions & 4 deletions crates/uv-warnings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ pub static ENABLED: AtomicBool = AtomicBool::new(false);

/// Enable user-facing warnings.
pub fn enable() {
ENABLED.store(true, std::sync::atomic::Ordering::SeqCst);
ENABLED.store(true, std::sync::atomic::Ordering::Relaxed);
}

/// Disable user-facing warnings.
pub fn disable() {
ENABLED.store(false, std::sync::atomic::Ordering::SeqCst);
ENABLED.store(false, std::sync::atomic::Ordering::Relaxed);
}

/// Warn a user, if warnings are enabled.
Expand All @@ -28,7 +28,7 @@ macro_rules! warn_user {
use $crate::anstream::eprintln;
use $crate::owo_colors::OwoColorize;

if $crate::ENABLED.load(std::sync::atomic::Ordering::SeqCst) {
if $crate::ENABLED.load(std::sync::atomic::Ordering::Relaxed) {
let message = format!("{}", format_args!($($arg)*));
let formatted = message.bold();
eprintln!("{}{} {formatted}", "warning".yellow().bold(), ":".bold());
Expand All @@ -46,7 +46,7 @@ macro_rules! warn_user_once {
use $crate::anstream::eprintln;
use $crate::owo_colors::OwoColorize;

if $crate::ENABLED.load(std::sync::atomic::Ordering::SeqCst) {
if $crate::ENABLED.load(std::sync::atomic::Ordering::Relaxed) {
if let Ok(mut states) = $crate::WARNINGS.lock() {
let message = format!("{}", format_args!($($arg)*));
if states.insert(message.clone()) {
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ async fn run(mut cli: Cli) -> Result<ExitStatus> {
}))?;

// Don't initialize the rayon threadpool yet, this is too costly when we're doing a noop sync.
uv_configuration::RAYON_PARALLELISM.store(globals.concurrency.installs, Ordering::SeqCst);
uv_configuration::RAYON_PARALLELISM.store(globals.concurrency.installs, Ordering::Relaxed);

debug!("uv {}", uv_cli::version::uv_self_version());

Expand Down
Loading