Finish and deactivate the current rolling buffer.
()
| 323 | |
| 324 | /// Finish and deactivate the current rolling buffer. |
| 325 | pub fn deactivate_rolling_buffer() { |
| 326 | // Stop the tick thread first |
| 327 | TICK_STOP.store(true, Ordering::Relaxed); |
| 328 | |
| 329 | if let Ok(mut guard) = ROLLING_BUFFER.lock() { |
| 330 | if let Some(rb) = guard.as_mut() { |
| 331 | rb.finish(); |
| 332 | } |
| 333 | *guard = None; |
| 334 | } |
| 335 | } |
| 336 | |
| 337 | #[cfg(test)] |
| 338 | mod tests; |