summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicha White <botahamec@outlook.com>2024-05-21 13:01:49 -0400
committerMicha White <botahamec@outlook.com>2024-05-21 13:01:49 -0400
commit875d5c4ad6e0c2a78c15476584fc686121b340d3 (patch)
tree1dcc715e7a3d3b0c7aac22667d860b70cbbdf84c
parent921b29c445f9c56fb7e41d1e94e61413a4f316c9 (diff)
Remove async experiment
-rw-r--r--src/mutex.rs24
1 files changed, 0 insertions, 24 deletions
diff --git a/src/mutex.rs b/src/mutex.rs
index cef338e..a3baa00 100644
--- a/src/mutex.rs
+++ b/src/mutex.rs
@@ -54,27 +54,3 @@ pub struct MutexGuard<'a, 'key: 'a, T: ?Sized + 'a, Key: Keyable + 'key, R: RawM
thread_key: Key,
_phantom: PhantomData<&'key ()>,
}
-
-struct MutexLockFuture<'a, T: ?Sized + 'a, R: RawMutex> {
- mutex: &'a Mutex<T, R>,
- key: Option<crate::ThreadKey>,
-}
-
-impl<'a, T: ?Sized + 'a, R: RawMutex> std::future::Future for MutexLockFuture<'a, T, R> {
- type Output = MutexGuard<'a, 'a, T, crate::ThreadKey, R>;
-
- fn poll(
- mut self: std::pin::Pin<&mut Self>,
- cx: &mut std::task::Context<'_>,
- ) -> std::task::Poll<Self::Output> {
- match unsafe { self.mutex.try_lock_no_key() } {
- Some(guard) => std::task::Poll::Ready(unsafe {
- MutexGuard::new(guard.0, self.key.take().unwrap())
- }),
- None => {
- cx.waker().wake_by_ref();
- std::task::Poll::Pending
- }
- }
- }
-}