/// # Examples
///
/// ```
- /// #![feature(arc_counts)]
- ///
/// use std::sync::Arc;
///
/// let five = Arc::new(5);
/// assert_eq!(1, Arc::weak_count(&five));
/// ```
#[inline]
- #[unstable(feature = "arc_counts", reason = "not clearly useful, and racy",
- issue = "28356")]
+ #[stable(feature = "arc_counts", since = "1.15.0")]
pub fn weak_count(this: &Self) -> usize {
this.inner().weak.load(SeqCst) - 1
}
/// # Examples
///
/// ```
- /// #![feature(arc_counts)]
- ///
/// use std::sync::Arc;
///
/// let five = Arc::new(5);
/// assert_eq!(2, Arc::strong_count(&five));
/// ```
#[inline]
- #[unstable(feature = "arc_counts", reason = "not clearly useful, and racy",
- issue = "28356")]
+ #[stable(feature = "arc_counts", since = "1.15.0")]
pub fn strong_count(this: &Self) -> usize {
this.inner().strong.load(SeqCst)
}