Skip to content

Commit

Permalink
Potential better fix for bevyengine#405
Browse files Browse the repository at this point in the history
  • Loading branch information
aclysma committed Sep 2, 2020
1 parent 6f42d7a commit eda1c35
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions crates/bevy_ecs/src/schedule/parallel_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,30 +352,31 @@ impl ExecutorStage {

run_ready_result = RunReadyResult::Ok;
} else {
// wait for a system to finish, then run its dependents
compute_pool.scope(|scope| {
loop {
// if all systems in the stage are finished, break out of the loop
if self.finished_systems.count_ones(..) == systems.len() {
break;
}
loop {
// if all systems in the stage are finished, break out of the loop
if self.finished_systems.count_ones(..) == systems.len() {
break;
}

let finished_system = self.receiver.recv().unwrap();
self.finished_systems.insert(finished_system);

let finished_system = self.receiver.recv().unwrap();
self.finished_systems.insert(finished_system);
// wait for a system to finish, then run its dependents
compute_pool.scope(|scope| {
run_ready_result = self.run_ready_systems(
systems,
RunReadyType::Dependents(finished_system),
scope,
world,
resources,
);
});

// if the next ready system is thread local, break out of this loop/bevy_tasks scope so it can be run
if let RunReadyResult::ThreadLocalReady(_) = run_ready_result {
break;
}
// if the next ready system is thread local, break out of this loop/bevy_tasks scope so it can be run
if let RunReadyResult::ThreadLocalReady(_) = run_ready_result {
break;
}
});
}
}
}

Expand Down

0 comments on commit eda1c35

Please sign in to comment.