summaryrefslogtreecommitdiffstats
path: root/tokio/src/runtime
diff options
context:
space:
mode:
authormental <m3nta1@yahoo.com>2020-09-02 20:37:13 +0100
committerGitHub <noreply@github.com>2020-09-02 12:37:13 -0700
commitc9f5bc29158a6f3a786e9d67df8da31524e8a9c3 (patch)
tree5a5036435833cf80b2bd81165e89a5c57795e9cc /tokio/src/runtime
parent5cdb6f8fd6be35f971d8ef7ea8984f4d01965620 (diff)
util: add `const fn` support for internal `LinkedList`. (#2805)
Diffstat (limited to 'tokio/src/runtime')
-rw-r--r--tokio/src/runtime/basic_scheduler.rs4
-rw-r--r--tokio/src/runtime/tests/task.rs4
-rw-r--r--tokio/src/runtime/thread_pool/worker.rs4
3 files changed, 6 insertions, 6 deletions
diff --git a/tokio/src/runtime/basic_scheduler.rs b/tokio/src/runtime/basic_scheduler.rs
index 48cff709..7bf8b445 100644
--- a/tokio/src/runtime/basic_scheduler.rs
+++ b/tokio/src/runtime/basic_scheduler.rs
@@ -1,7 +1,7 @@
use crate::park::{Park, Unpark};
use crate::runtime;
use crate::runtime::task::{self, JoinHandle, Schedule, Task};
-use crate::util::linked_list::LinkedList;
+use crate::util::linked_list::{Link, LinkedList};
use crate::util::{waker_ref, Wake};
use std::cell::RefCell;
@@ -42,7 +42,7 @@ pub(crate) struct Spawner {
struct Tasks {
/// Collection of all active tasks spawned onto this executor.
- owned: LinkedList<Task<Arc<Shared>>>,
+ owned: LinkedList<Task<Arc<Shared>>, <Task<Arc<Shared>> as Link>::Target>,
/// Local run queue.
///
diff --git a/tokio/src/runtime/tests/task.rs b/tokio/src/runtime/tests/task.rs
index 82315a04..a34526f3 100644
--- a/tokio/src/runtime/tests/task.rs
+++ b/tokio/src/runtime/tests/task.rs
@@ -1,5 +1,5 @@
use crate::runtime::task::{self, Schedule, Task};
-use crate::util::linked_list::LinkedList;
+use crate::util::linked_list::{Link, LinkedList};
use crate::util::TryLock;
use std::collections::VecDeque;
@@ -72,7 +72,7 @@ struct Inner {
struct Core {
queue: VecDeque<task::Notified<Runtime>>,
- tasks: LinkedList<Task<Runtime>>,
+ tasks: LinkedList<Task<Runtime>, <Task<Runtime> as Link>::Target>,
}
static CURRENT: TryLock<Option<Runtime>> = TryLock::new(None);
diff --git a/tokio/src/runtime/thread_pool/worker.rs b/tokio/src/runtime/thread_pool/worker.rs
index ac052854..10e973f6 100644
--- a/tokio/src/runtime/thread_pool/worker.rs
+++ b/tokio/src/runtime/thread_pool/worker.rs
@@ -12,7 +12,7 @@ use crate::runtime;
use crate::runtime::park::{Parker, Unparker};
use crate::runtime::thread_pool::{AtomicCell, Idle};
use crate::runtime::{queue, task};
-use crate::util::linked_list::LinkedList;
+use crate::util::linked_list::{Link, LinkedList};
use crate::util::FastRand;
use std::cell::RefCell;
@@ -53,7 +53,7 @@ struct Core {
is_shutdown: bool,
/// Tasks owned by the core
- tasks: LinkedList<Task>,
+ tasks: LinkedList<Task, <Task as Link>::Target>,
/// Parker
///