Skip to content

Commit

Permalink
Use portable-atomic when AtomicU64 is not available.
Browse files Browse the repository at this point in the history
  • Loading branch information
flaviojs committed Jan 7, 2025
1 parent 6e2a586 commit ef95a22
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions bb8/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ futures-util = { version = "0.3.2", default-features = false, features = ["alloc
parking_lot = { version = "0.12", optional = true }
tokio = { version = "1.0", features = ["rt", "sync", "time"] }

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

[dev-dependencies]
tokio = { version = "1.0", features = ["macros"] }

Expand Down
6 changes: 5 additions & 1 deletion bb8/src/internals.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#[cfg(not(target_has_atomic = "64"))]
use portable_atomic::AtomicU64;
use std::cmp::min;
use std::collections::VecDeque;
use std::sync::atomic::{AtomicU64, Ordering};
#[cfg(target_has_atomic = "64")]
use std::sync::atomic::AtomicU64;
use std::sync::atomic::Ordering;
use std::sync::Arc;
use std::time::{Duration, Instant};

Expand Down

0 comments on commit ef95a22

Please sign in to comment.