A number of small updates batched into one commit

This commit is contained in:
Nadja Reitzenstein 2022-06-23 13:33:29 +02:00
parent 9a86bae45a
commit 567df800f3
5 changed files with 9 additions and 5 deletions

View File

@ -256,7 +256,7 @@ where
self.spawn_callsites.insert(metadata);
&self.shared.dropped_tasks
}
(_, WakerVisitor::WAKE_TARGET) => {
(_, WakerVisitor::WAKER_EVENT_TARGET) => {
self.waker_callsites.insert(metadata);
&self.shared.dropped_tasks
}
@ -419,6 +419,7 @@ where
}
}
}
} else if self.poll_op_callsites.contains(metadata) {
}
}

View File

@ -369,7 +369,7 @@ impl Visit for AsyncOpVisitor {
}
impl WakerVisitor {
pub(crate) const WAKE_TARGET: &'static str = "executor::waker";
pub(crate) const WAKER_EVENT_TARGET: &'static str = "executor::waker";
const WAKE: &'static str = "waker.wake";
const WAKE_BY_REF: &'static str = "waker.wake_by_ref";

View File

@ -117,10 +117,10 @@ impl<'a, 'executor: 'a> Executor<'executor> {
target: "executor::task",
parent: Span::current(),
"runtime.spawn",
kind = "global",
loc.file = location.file(),
loc.line = location.line(),
loc.col = location.column(),
kind = "global",
);
let (task, handle) = LightProc::recoverable(future, self.schedule(), span);
@ -140,10 +140,10 @@ impl<'a, 'executor: 'a> Executor<'executor> {
target: "executor::task",
parent: Span::current(),
"runtime.spawn",
kind = "local",
loc.file = location.file(),
loc.line = location.line(),
loc.col = location.column(),
kind = "local",
);
let (task, handle) = LightProc::recoverable(future, schedule_local(), span);

View File

@ -22,6 +22,8 @@ pub struct ProcHandle<R> {
pub(crate) raw_proc: NonNull<()>,
/// A marker capturing the generic type `R`.
// TODO: Instead of writing the future output to the RawProc on heap, put it in the handle
// (if still available).
pub(crate) result: PhantomData<R>,
}

View File

@ -24,7 +24,8 @@ pub(crate) struct RawProc<'a, F, R, S> {
pub(crate) pdata: *const ProcData,
pub(crate) schedule: *const S,
pub(crate) future: *mut F,
// TODO: Replace with `MaybeUninit`
// TODO: Replace with `*mut MaybeUninit`? And also, store the result in the handle if that's
// still available, instead of copying it to the heap.
pub(crate) output: *mut R,
// Make the lifetime 'a of the future invariant