pub struct Mutex<T: ?Sized>(_);
Expand description
Documentation still incomplete. API similar to std::sync::Mutex
.
Examples
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
fn poll_shared_future<F: Future>(
fut: &Pin<Arc<pinnable::Mutex<F>>>,
ctx: &mut Context<'_>,
) -> Poll<F::Output> {
fut.as_ref().lock().unwrap().as_mut().poll(ctx)
}