This commit is contained in:
noah
2026-05-29 16:25:29 -05:00
parent a3860a9f37
commit 4f2f942e18
4 changed files with 27 additions and 35 deletions
@@ -2,9 +2,7 @@ use crate::loom::sync::atomic::AtomicBool;
use crate::loom::sync::Arc;
use crate::runtime::driver::{self, Driver};
use crate::runtime::scheduler::{self, Defer, Inject};
use crate::runtime::task::{
self, JoinHandle, OwnedTasks, Schedule, SpawnLocation, Task,
};
use crate::runtime::task::{self, JoinHandle, OwnedTasks, Schedule, SpawnLocation, Task};
use crate::runtime::{
blocking, context, Config, MetricsBatch, SchedulerMetrics, TaskHooks, TaskMeta, WorkerMetrics,
};
+2 -4
View File
@@ -127,8 +127,7 @@ impl<S: 'static> OwnedTasks<S> {
T: Future + Send + 'static,
T::Output: Send + 'static,
{
let (task, notified, join) =
super::new_task(task, scheduler, id, spawned_at, user_data);
let (task, notified, join) = super::new_task(task, scheduler, id, spawned_at, user_data);
before_bind(&task);
let notified = unsafe { self.bind_inner(task, notified) };
(join, notified)
@@ -183,8 +182,7 @@ impl<S: 'static> OwnedTasks<S> {
T: Future + 'static,
T::Output: 'static,
{
let (task, notified, join) =
super::new_task(task, scheduler, id, spawned_at, user_data);
let (task, notified, join) = super::new_task(task, scheduler, id, spawned_at, user_data);
before_bind(&task);
let notified = unsafe { self.bind_inner(task, notified) };
(join, notified)
+16 -19
View File
@@ -19,7 +19,6 @@ mod noop_scheduler {
fn schedule(&self, _task: task::Notified<Self>) {
unreachable!();
}
}
}
@@ -37,15 +36,14 @@ mod unowned_wrapper {
use tracing::Instrument;
let span = tracing::trace_span!("test_span");
let task = task.instrument(span);
let (task, handle) =
crate::runtime::task::unowned(
task,
NoopSchedule,
Id::next(),
SpawnLocation::capture(),
#[cfg(tokio_unstable)]
None,
);
let (task, handle) = crate::runtime::task::unowned(
task,
NoopSchedule,
Id::next(),
SpawnLocation::capture(),
#[cfg(tokio_unstable)]
None,
);
(task.into_notified(), handle)
}
@@ -56,15 +54,14 @@ mod unowned_wrapper {
T: std::future::Future + Send + 'static,
T::Output: Send + 'static,
{
let (task, handle) =
crate::runtime::task::unowned(
task,
NoopSchedule,
Id::next(),
SpawnLocation::capture(),
#[cfg(tokio_unstable)]
None,
);
let (task, handle) = crate::runtime::task::unowned(
task,
NoopSchedule,
Id::next(),
SpawnLocation::capture(),
#[cfg(tokio_unstable)]
None,
);
(task.into_notified(), handle)
}
}
+8 -9
View File
@@ -421,15 +421,14 @@ impl Runtime {
T: 'static + Send + Future,
T::Output: 'static + Send,
{
let (handle, notified) =
self.0.owned.bind(
future,
self.clone(),
Id::next(),
SpawnLocation::capture(),
#[cfg(tokio_unstable)]
None,
);
let (handle, notified) = self.0.owned.bind(
future,
self.clone(),
Id::next(),
SpawnLocation::capture(),
#[cfg(tokio_unstable)]
None,
);
if let Some(notified) = notified {
self.schedule(notified);