Skip to content

Commit

Permalink
Update multi_threaded.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
maniwani committed Nov 15, 2022
1 parent 3b72d84 commit 3c1cdbf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions crates/bevy_ecs/src/schedule_v3/executor/multi_threaded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ struct SystemTaskMetadata {
}

/// Runs the schedule using a thread pool. Non-conflicting systems can run in parallel.
///
/// **Note:** If there are no ambiguities between systems with conflicting access, this will return
/// the same results as the [`SingleThreadedExecutor`].
pub struct MultiThreadedExecutor {
/// Metadata for scheduling and running system tasks.
system_task_metadata: Vec<SystemTaskMetadata>,
Expand Down Expand Up @@ -345,9 +342,9 @@ impl MultiThreadedExecutor {

fn can_run(&mut self, system_index: usize, schedule: &SystemSchedule, world: &World) -> bool {
#[cfg(feature = "trace")]
let system = schedule.systems[system_index].borrow();
let name = schedule.systems[system_index].borrow().name();
#[cfg(feature = "trace")]
let _span = info_span!("check_access", name = &*system.name()).entered();
let _span = info_span!("check_access", name = &*name).entered();

let system_meta = &mut self.system_task_metadata[system_index];
if self.local_thread_running && !system_meta.is_send {
Expand Down Expand Up @@ -386,9 +383,9 @@ impl MultiThreadedExecutor {
world: &World,
) -> bool {
#[cfg(feature = "trace")]
let system = schedule.systems[system_index].borrow();
let name = schedule.systems[system_index].borrow().name();
#[cfg(feature = "trace")]
let _span = info_span!("check_conditions", name = &*system.name()).entered();
let _span = info_span!("check_conditions", name = &*name).entered();

// evaluate conditions
let mut should_run = true;
Expand Down

0 comments on commit 3c1cdbf

Please sign in to comment.