summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorMike White <botahamec@outlook.com>2021-09-18 12:25:15 -0400
committerMike White <botahamec@outlook.com>2021-09-18 12:25:15 -0400
commitf1d3cf99a122c63e09f33ca30d6c09fd29d66a24 (patch)
treec8371c1a8ecd3851b00081bb9ae0cd6d81c4b313 /model
parent022ad804720a9cede6e8e463ad4bf82db3588f84 (diff)
Implement multithreading
Diffstat (limited to 'model')
-rw-r--r--model/Cargo.toml1
-rw-r--r--model/src/possible_moves.rs3
2 files changed, 4 insertions, 0 deletions
diff --git a/model/Cargo.toml b/model/Cargo.toml
index f264a17..cdda386 100644
--- a/model/Cargo.toml
+++ b/model/Cargo.toml
@@ -8,6 +8,7 @@ edition = "2018"
[dependencies]
serde = { version = "1.0.126", optional = true, features = ["derive"] }
+rayon = "1"
[dev-dependencies]
proptest = "1.0.0"
diff --git a/model/src/possible_moves.rs b/model/src/possible_moves.rs
index 98a25e2..7d32a27 100644
--- a/model/src/possible_moves.rs
+++ b/model/src/possible_moves.rs
@@ -1,5 +1,6 @@
use crate::moves::{Move, MoveDirection};
use crate::{CheckersBitBoard, PieceColor};
+
use std::alloc::{alloc, dealloc, handle_alloc_error, Layout};
use std::mem::MaybeUninit;
use std::ptr::NonNull;
@@ -94,6 +95,8 @@ impl PossibleMovesIter {
}
}
+unsafe impl Send for PossibleMovesIter {}
+
impl Iterator for PossibleMovesIter {
type Item = Move;