summaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
authorNathan Lee <me@nwlee.tech>2026-06-10 22:27:19 -0500
committerNathan Lee <me@nwlee.tech>2026-06-10 22:27:19 -0500
commitf94c087120bf2a241dda51d6311c565dd03b96be (patch)
tree102d074b949bf5cd8caef386818c80153f254e4c /src/state.rs
parenta37a07533fa9b8bd8962ca3c1aea082ae2548651 (diff)
move atomics into core.rs
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/state.rs b/src/state.rs
index dcb1959..adf6a5b 100644
--- a/src/state.rs
+++ b/src/state.rs
@@ -19,4 +19,15 @@ impl CpuState {
reservations: HashSet::new()
}
}
+
+ pub fn release_reservations(&mut self, indices: &[usize]) {
+ for index in indices {
+ self.reservations.remove(&index);
+ }
+ }
+ pub fn acquire_reservations(&mut self, indices: &[usize]) {
+ for index in indices {
+ self.reservations.insert(*index);
+ }
+ }
} \ No newline at end of file