Rollback a reservation: decrement the counter, recycle the number. Releases the per-sequence lock so the next caller can proceed. `rollback_fn` is called to decrement the sequence counter by one increment.
(&self, handle: &ReservationHandle, rollback_fn: impl FnOnce())
| 140 | /// |
| 141 | /// `rollback_fn` is called to decrement the sequence counter by one increment. |
| 142 | pub fn rollback(&self, handle: &ReservationHandle, rollback_fn: impl FnOnce()) { |
| 143 | rollback_fn(); |
| 144 | |
| 145 | let locks = self.locks.lock().unwrap_or_else(|p| p.into_inner()); |
| 146 | if let Some(lock) = locks.get(&handle.sequence_key) { |
| 147 | self.unlock_sequence(lock); |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | /// Release the per-sequence lock and wake one blocked waiter. |
| 152 | fn unlock_sequence(&self, lock: &SequenceLock) { |