wip: don't lock command mutex for each mass/spring in FillGraph()

This commit is contained in:
2026-02-24 02:05:44 +01:00
parent 550970f8a1
commit 74065b7ea2
5 changed files with 35 additions and 10 deletions

View File

@ -37,12 +37,12 @@ auto StateManager::FillGraph() -> void {
std::pair<std::unordered_set<State>, std::vector<std::pair<State, State>>>
closure = current_state.Closure();
for (const auto &state : closure.first) {
physics.AddMassCmd(state);
}
for (const auto &[from, to] : closure.second) {
physics.AddSpringCmd(from, to);
}
physics.AddMassSpringsCmd(closure.first, closure.second);
// TODO: We have only dispatched the commands, the states won't be downloaded
// when calling this... Make FindWinningStates() another command?
// Or recalculate whenever masses.size() changes?
FindWinningStates();
}