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
44 changes: 22 additions & 22 deletions src/atomic_cell.rs → crossbeam-utils/src/atomic/atomic_cell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl<T> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(7);
/// ```
Expand All @@ -48,7 +48,7 @@ impl<T> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let mut a = AtomicCell::new(7);
/// *a.get_mut() += 1;
Expand All @@ -64,7 +64,7 @@ impl<T> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let mut a = AtomicCell::new(7);
/// let v = a.into_inner();
Expand All @@ -83,7 +83,7 @@ impl<T> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// // This type is internally represented as `AtomicUsize` so we can just use atomic
/// // operations provided by it.
Expand Down Expand Up @@ -112,7 +112,7 @@ impl<T> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(7);
///
Expand All @@ -135,7 +135,7 @@ impl<T> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(7);
///
Expand All @@ -154,7 +154,7 @@ impl<T: Copy> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(7);
///
Expand All @@ -174,7 +174,7 @@ impl<T: Copy + Eq> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(1);
///
Expand All @@ -199,7 +199,7 @@ impl<T: Copy + Eq> AtomicCell<T> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(1);
///
Expand Down Expand Up @@ -239,7 +239,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand Down Expand Up @@ -267,7 +267,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand All @@ -293,7 +293,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand All @@ -319,7 +319,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand All @@ -345,7 +345,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand Down Expand Up @@ -376,7 +376,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand All @@ -396,7 +396,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand All @@ -414,7 +414,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand All @@ -432,7 +432,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand All @@ -450,7 +450,7 @@ macro_rules! impl_arithmetic {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
#[doc = $example]
///
Expand Down Expand Up @@ -505,7 +505,7 @@ impl AtomicCell<bool> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(true);
///
Expand All @@ -526,7 +526,7 @@ impl AtomicCell<bool> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(false);
///
Expand All @@ -547,7 +547,7 @@ impl AtomicCell<bool> {
/// # Examples
///
/// ```
/// use crossbeam::atomic::AtomicCell;
/// use crossbeam_utils::atomic::AtomicCell;
///
/// let a = AtomicCell::new(true);
///
Expand Down
2 changes: 2 additions & 0 deletions crossbeam-utils/src/atomic/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Additional utilities for atomics.

mod atomic_cell;
mod consume;

pub use self::atomic_cell::AtomicCell;
pub use self::consume::AtomicConsume;
4 changes: 2 additions & 2 deletions tests/atomic_cell.rs → crossbeam-utils/tests/atomic_cell.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
extern crate crossbeam;
extern crate crossbeam_utils;

use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering::SeqCst;

use crossbeam::atomic::AtomicCell;
use crossbeam_utils::atomic::AtomicCell;

#[test]
fn is_lock_free() {
Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,13 @@ mod _epoch {
pub use _epoch::crossbeam_epoch as epoch;

mod arc_cell;
mod atomic_cell;

extern crate crossbeam_utils;

/// Additional utilities for atomics.
pub mod atomic {
pub use arc_cell::ArcCell;
pub use atomic_cell::AtomicCell;
pub use crossbeam_utils::atomic::AtomicCell;
pub use crossbeam_utils::atomic::AtomicConsume;
}

Expand Down