use thread pool

This commit is contained in:
Evan Almloff committed 2023-02-02 07:08:29 -06:00
1 parent d67b21c0e9
commit 687cdf2cac
2 files changed
+4 -2

No files matched your search

+2
View File
@@ -28,6 +28,8 @@ hashbrown = { version = "0.13.2", features = ["raw"] }
# for parsing attributes
lightningcss = "1.0.0-alpha.39"
rayon = "1.6.1"
[dev-dependencies]
rand = "0.8.5"
dioxus = { path = "../dioxus", version = "^0.3.0" }
+2 -2
View File
@@ -390,7 +390,7 @@ pub fn resolve_passes<V: FromAnyValue + Send + Sync>(
while !pass_indexes_remaining.is_empty() {
let mut currently_in_use = FxHashSet::<TypeId>::default();
let dynamically_borrowed_tree = tree.tree.dynamically_borrowed();
std::thread::scope(|s| {
rayon::in_place_scope(|s| {
let mut i = 0;
while i < pass_indexes_remaining.len() {
let passes_idx = pass_indexes_remaining[i];
@@ -414,7 +414,7 @@ pub fn resolve_passes<V: FromAnyValue + Send + Sync>(
let dirty_nodes = dirty_nodes.clone();
let nodes_updated = nodes_updated.clone();
let ctx = ctx.clone();
s.spawn(move || {
s.spawn(move |_| {
pass.resolve(tree_view, &dirty_nodes, &nodes_updated, &ctx);
});
} else {