/// # Examples
///
/// ```
-/// use std::sync::{Once, ONCE_INIT};
+/// use std::sync::Once;
///
-/// static START: Once = ONCE_INIT;
+/// static START: Once = Once::new();
///
/// START.call_once(|| {
/// // run initialization here
/// # Examples
///
/// ```
- /// use std::sync::{Once, ONCE_INIT};
+ /// use std::sync::Once;
///
/// static mut VAL: usize = 0;
- /// static INIT: Once = ONCE_INIT;
+ /// static INIT: Once = Once::new();
///
/// // Accessing a `static mut` is unsafe much of the time, but if we do so
/// // in a synchronized fashion (e.g. write once or read all) then we're
/// ```
/// #![feature(once_poison)]
///
- /// use std::sync::{Once, ONCE_INIT};
+ /// use std::sync::Once;
/// use std::thread;
///
- /// static INIT: Once = ONCE_INIT;
+ /// static INIT: Once = Once::new();
///
/// // poison the once
/// let handle = thread::spawn(|| {
/// ```
/// #![feature(once_poison)]
///
- /// use std::sync::{Once, ONCE_INIT};
+ /// use std::sync::Once;
/// use std::thread;
///
- /// static INIT: Once = ONCE_INIT;
+ /// static INIT: Once = Once::new();
///
/// // poison the once
/// let handle = thread::spawn(|| {
/// ```
/// #![feature(once_poison)]
///
- /// use std::sync::{Once, ONCE_INIT};
+ /// use std::sync::Once;
///
- /// static INIT: Once = ONCE_INIT;
+ /// static INIT: Once = Once::new();
///
/// INIT.call_once_force(|state| {
/// assert!(!state.poisoned());