summaryrefslogtreecommitdiff
path: root/src/state.rs
diff options
context:
space:
mode:
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