diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /vendor/tokio/src/runtime/tests/mod.rs | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/tokio/src/runtime/tests/mod.rs')
-rw-r--r-- | vendor/tokio/src/runtime/tests/mod.rs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/vendor/tokio/src/runtime/tests/mod.rs b/vendor/tokio/src/runtime/tests/mod.rs new file mode 100644 index 000000000..3f2cc9825 --- /dev/null +++ b/vendor/tokio/src/runtime/tests/mod.rs @@ -0,0 +1,40 @@ +#[cfg(not(all(tokio_unstable, feature = "tracing")))] +use crate::runtime::task::joinable; + +#[cfg(all(tokio_unstable, feature = "tracing"))] +use self::joinable_wrapper::joinable; + +#[cfg(all(tokio_unstable, feature = "tracing"))] +mod joinable_wrapper { + use crate::runtime::task::{JoinHandle, Notified, Schedule}; + use tracing::Instrument; + + pub(crate) fn joinable<T, S>(task: T) -> (Notified<S>, JoinHandle<T::Output>) + where + T: std::future::Future + Send + 'static, + S: Schedule, + { + let span = tracing::trace_span!("test_span"); + crate::runtime::task::joinable(task.instrument(span)) + } +} + +cfg_loom! { + mod loom_basic_scheduler; + mod loom_local; + mod loom_blocking; + mod loom_oneshot; + mod loom_pool; + mod loom_queue; + mod loom_shutdown_join; +} + +cfg_not_loom! { + mod queue; + + #[cfg(not(miri))] + mod task_combinations; + + #[cfg(miri)] + mod task; +} |