Commit a reservation: the number is now permanent. Releases the per-sequence lock so the next caller can proceed.
(&self, handle: &ReservationHandle)
| 129 | /// Commit a reservation: the number is now permanent. |
| 130 | /// Releases the per-sequence lock so the next caller can proceed. |
| 131 | pub fn commit(&self, handle: &ReservationHandle) { |
| 132 | let locks = self.locks.lock().unwrap_or_else(|p| p.into_inner()); |
| 133 | if let Some(lock) = locks.get(&handle.sequence_key) { |
| 134 | self.unlock_sequence(lock); |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | /// Rollback a reservation: decrement the counter, recycle the number. |
| 139 | /// Releases the per-sequence lock so the next caller can proceed. |