Skip to content

Commit

Permalink
Remove parking_lot dependency from bevy_ecs (bevyengine#4543)
Browse files Browse the repository at this point in the history
It is only used in some tests so any potential performance regressions don't matter.
  • Loading branch information
bjorn3 authored and exjam committed May 22, 2022
1 parent 382c3d0 commit c1e40b8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
1 change: 0 additions & 1 deletion crates/bevy_ecs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ downcast-rs = "1.2"
serde = "1"

[dev-dependencies]
parking_lot = "0.11"
rand = "0.8"

[[example]]
Expand Down
15 changes: 7 additions & 8 deletions crates/bevy_ecs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,11 @@ mod tests {
world::{Mut, World},
};
use bevy_tasks::TaskPool;
use parking_lot::Mutex;
use std::{
any::TypeId,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
Arc, Mutex,
},
};

Expand Down Expand Up @@ -383,11 +382,11 @@ mod tests {
world
.query::<(Entity, &A)>()
.par_for_each(&world, &task_pool, 2, |(e, &A(i))| {
results.lock().push((e, i));
results.lock().unwrap().push((e, i));
});
results.lock().sort();
results.lock().unwrap().sort();
assert_eq!(
&*results.lock(),
&*results.lock().unwrap(),
&[(e1, 1), (e2, 2), (e3, 3), (e4, 4), (e5, 5)]
);
}
Expand All @@ -407,11 +406,11 @@ mod tests {
&world,
&task_pool,
2,
|(e, &SparseStored(i))| results.lock().push((e, i)),
|(e, &SparseStored(i))| results.lock().unwrap().push((e, i)),
);
results.lock().sort();
results.lock().unwrap().sort();
assert_eq!(
&*results.lock(),
&*results.lock().unwrap(),
&[(e1, 1), (e2, 2), (e3, 3), (e4, 4), (e5, 5)]
);
}
Expand Down

0 comments on commit c1e40b8

Please sign in to comment.