mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-25 12:00:35 +00:00
blocking: #[track_caller]
for spawn_blocking (#4616)
Annotates spawn_blocking() with #[track_caller] in order to produce the correct tracing span spawn locations that show the caller as the spawn point.
This commit is contained in:
parent
252b0fa9d5
commit
221bb94b9c
@ -104,6 +104,7 @@ const KEEP_ALIVE: Duration = Duration::from_secs(10);
|
||||
/// Runs the provided function on an executor dedicated to blocking operations.
|
||||
/// Tasks will be scheduled as non-mandatory, meaning they may not get executed
|
||||
/// in case of runtime shutdown.
|
||||
#[track_caller]
|
||||
pub(crate) fn spawn_blocking<F, R>(func: F) -> JoinHandle<R>
|
||||
where
|
||||
F: FnOnce() -> R + Send + 'static,
|
||||
|
Loading…
x
Reference in New Issue
Block a user