Skip to content

Commit

Permalink
fix: 64-bit atomics for platforms with no 64-bit atomics
Browse files Browse the repository at this point in the history
Closes: #423
  • Loading branch information
NoisyCoil authored and bootandy committed Aug 9, 2024
1 parent f48fcc7 commit 489d9ad
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ sysinfo = "0.27"
ctrlc = "3.4"
chrono = "0.4"

[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
portable-atomic = "1.4"

[target.'cfg(windows)'.dependencies]
winapi-util = "0.1"
filesize = "0.2.0"
Expand Down
7 changes: 6 additions & 1 deletion src/progress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@ use std::{
io::Write,
path::Path,
sync::{
atomic::{AtomicU64, AtomicU8, AtomicUsize, Ordering},
atomic::{AtomicU8, AtomicUsize, Ordering},
mpsc::{self, RecvTimeoutError, Sender},
Arc, RwLock,
},
thread::JoinHandle,
time::Duration,
};

#[cfg(not(target_has_atomic = "64"))]
use portable_atomic::AtomicU64;
#[cfg(target_has_atomic = "64")]
use std::sync::atomic::AtomicU64;

use crate::display::human_readable_number;

/* -------------------------------------------------------------------------- */
Expand Down

0 comments on commit 489d9ad

Please sign in to comment.