Skip to content

Commit

Permalink
Provide a Default implementation for AtomicPtr
Browse files Browse the repository at this point in the history
Closes #24613
  • Loading branch information
shepmaster committed Apr 26, 2015
1 parent da62384 commit 7c548a2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/libcore/atomic.rs
Expand Up @@ -129,6 +129,12 @@ pub struct AtomicPtr<T> {
_marker: PhantomData<*mut T>,
}

impl<T> Default for AtomicPtr<T> {
fn default() -> AtomicPtr<T> {
AtomicPtr::new(::ptr::null_mut())
}
}

unsafe impl<T> Sync for AtomicPtr<T> {}

/// Atomic memory orderings
Expand Down

0 comments on commit 7c548a2

Please sign in to comment.