aboutsummaryrefslogtreecommitdiff
path: root/src/sync/parker.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/sync/parker.rs')
-rw-r--r--src/sync/parker.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/sync/parker.rs b/src/sync/parker.rs
index 531f5a5..e791c44 100644
--- a/src/sync/parker.rs
+++ b/src/sync/parker.rs
@@ -44,6 +44,7 @@ use std::time::{Duration, Instant};
///
/// // Wakes up when `u.unpark()` provides the token.
/// p.park();
+/// # std::thread::sleep(std::time::Duration::from_millis(500)); // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
/// ```
///
/// [`park`]: Parker::park
@@ -241,6 +242,7 @@ impl Unparker {
///
/// // Wakes up when `u.unpark()` provides the token.
/// p.park();
+ /// # std::thread::sleep(std::time::Duration::from_millis(500)); // wait for background threads closed: https://github.com/rust-lang/miri/issues/1371
/// ```
///
/// [`park`]: Parker::park
@@ -262,7 +264,7 @@ impl Unparker {
/// # let _ = unsafe { Unparker::from_raw(raw) };
/// ```
pub fn into_raw(this: Unparker) -> *const () {
- Arc::into_raw(this.inner) as *const ()
+ Arc::into_raw(this.inner).cast::<()>()
}
/// Converts a raw pointer into an `Unparker`.
@@ -284,7 +286,7 @@ impl Unparker {
/// ```
pub unsafe fn from_raw(ptr: *const ()) -> Unparker {
Unparker {
- inner: Arc::from_raw(ptr as *const Inner),
+ inner: Arc::from_raw(ptr.cast::<Inner>()),
}
}
}