mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 04:33:37 +00:00
Fix bevy_ecs::schedule::executor_parallel::system span management (#2905)
# Objective - Fixes #2904 (see for context) ## Solution - Simply hoist span creation out of the threaded task - Confirmed to solve the issue locally Now all events have the full span parent tree up through `bevy_ecs::schedule::stage` all the way to `bevy_app::app::bevy_app` (and its parents in bevy-consumer code, if any).
This commit is contained in:
parent
a60fe30ada
commit
0887f41b58
1 changed files with 2 additions and 3 deletions
|
@ -182,15 +182,14 @@ impl ParallelExecutor {
|
|||
let start_receiver = system_data.start_receiver.clone();
|
||||
let finish_sender = self.finish_sender.clone();
|
||||
let system = unsafe { systems[index].system_mut_unsafe() };
|
||||
#[cfg(feature = "trace")] // NB: outside the task to get the TLS current span
|
||||
let system_span = bevy_utils::tracing::info_span!("system", name = &*system.name());
|
||||
let task = async move {
|
||||
start_receiver
|
||||
.recv()
|
||||
.await
|
||||
.unwrap_or_else(|error| unreachable!(error));
|
||||
#[cfg(feature = "trace")]
|
||||
let system_span =
|
||||
bevy_utils::tracing::info_span!("system", name = &*system.name());
|
||||
#[cfg(feature = "trace")]
|
||||
let system_guard = system_span.enter();
|
||||
unsafe { system.run_unsafe((), world) };
|
||||
#[cfg(feature = "trace")]
|
||||
|
|
Loading…
Reference in a new issue