From c9f5bc29158a6f3a786e9d67df8da31524e8a9c3 Mon Sep 17 00:00:00 2001 From: mental Date: Wed, 2 Sep 2020 20:37:13 +0100 Subject: util: add `const fn` support for internal `LinkedList`. (#2805) --- tokio/src/sync/notify.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'tokio/src/sync/notify.rs') diff --git a/tokio/src/sync/notify.rs b/tokio/src/sync/notify.rs index 84a94823..def704f2 100644 --- a/tokio/src/sync/notify.rs +++ b/tokio/src/sync/notify.rs @@ -10,6 +10,8 @@ use std::ptr::NonNull; use std::sync::atomic::Ordering::SeqCst; use std::task::{Context, Poll, Waker}; +type WaitList = LinkedList::Target>; + /// Notify a single task to wake up. /// /// `Notify` provides a basic mechanism to notify a single task of an event. @@ -101,7 +103,7 @@ use std::task::{Context, Poll, Waker}; #[derive(Debug)] pub struct Notify { state: AtomicU8, - waiters: Mutex>, + waiters: Mutex, } #[derive(Debug)] @@ -285,7 +287,7 @@ impl Default for Notify { } } -fn notify_locked(waiters: &mut LinkedList, state: &AtomicU8, curr: u8) -> Option { +fn notify_locked(waiters: &mut WaitList, state: &AtomicU8, curr: u8) -> Option { loop { match curr { EMPTY | NOTIFIED => { -- cgit v1.2.3