diff options
| author | Nathan Lee <me@nwlee.tech> | 2026-06-10 22:27:19 -0500 |
|---|---|---|
| committer | Nathan Lee <me@nwlee.tech> | 2026-06-10 22:27:19 -0500 |
| commit | f94c087120bf2a241dda51d6311c565dd03b96be (patch) | |
| tree | 102d074b949bf5cd8caef386818c80153f254e4c /src/state.rs | |
| parent | a37a07533fa9b8bd8962ca3c1aea082ae2548651 (diff) | |
move atomics into core.rs
Diffstat (limited to 'src/state.rs')
| -rw-r--r-- | src/state.rs | 11 |
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 |
