diff --git a/tokio/bar.txt b/tokio/bar.txt new file mode 100644 index 00000000000..01309020fe7 --- /dev/null +++ b/tokio/bar.txt @@ -0,0 +1 @@ +Hello File! \ No newline at end of file diff --git a/tokio/foo.txt b/tokio/foo.txt new file mode 100644 index 00000000000..01309020fe7 --- /dev/null +++ b/tokio/foo.txt @@ -0,0 +1 @@ +Hello File! \ No newline at end of file diff --git a/tokio/src/runtime/builder.rs b/tokio/src/runtime/builder.rs index 77c2e200d25..e8949e59b95 100644 --- a/tokio/src/runtime/builder.rs +++ b/tokio/src/runtime/builder.rs @@ -2,10 +2,7 @@ use crate::runtime::handle::Handle; use crate::runtime::shell::Shell; use crate::runtime::{blocking, io, time, Callback, Runtime, Spawner}; -#[cfg(loom)] -use crate::loom::sync::Arc; use std::fmt; -#[cfg(not(loom))] use std::sync::Arc; /// Builds Tokio Runtime with custom configuration values. @@ -70,7 +67,7 @@ pub struct Builder { pub(super) before_stop: Option, } -pub(crate) type ThreadNameFn = Arc String + Send + Sync + 'static>>; +pub(crate) type ThreadNameFn = Arc String + Send + Sync + 'static>; #[derive(Debug, Clone, Copy)] enum Kind { @@ -103,7 +100,7 @@ impl Builder { max_threads: 512, // Default thread name - thread_name: Arc::new(Box::new(|| "tokio-runtime-worker".into())), + thread_name: Arc::new(|| "tokio-runtime-worker".into()), // Do not set a stack size by default thread_stack_size: None, @@ -215,7 +212,7 @@ impl Builder { /// ``` pub fn thread_name(&mut self, val: impl Into) -> &mut Self { let val = val.into(); - self.thread_name = Arc::new(Box::new(move || val.clone())); + self.thread_name = Arc::new(move || val.clone()); self } @@ -243,7 +240,7 @@ impl Builder { where F: Fn() -> String + Send + Sync + 'static, { - self.thread_name = Arc::new(Box::new(f)); + self.thread_name = Arc::new(f); self }