use core::cell::Cell;
use std::thread::LocalKey;
std::thread_local! {
pub(in super::super) static SPINS: Cell<usize> = const { Cell::new(0) };
pub(in super::super) static MARKED_WHILE_SPINNING: Cell<usize> = const { Cell::new(0) };
pub(in super::super) static MARKED_AFTER_LAST_READ: Cell<usize> = const { Cell::new(0) };
pub(in super::super) static SKIP_LOOK: Cell<bool> = const { Cell::new(false) };
}
pub(in super::super) fn count(counter: &'static LocalKey<Cell<usize>>) {
counter.with(|c| c.set(c.get() + 1));
}
pub(in super::super) fn take() -> [usize; 3] {
[&SPINS, &MARKED_WHILE_SPINNING, &MARKED_AFTER_LAST_READ].map(|c| c.with(|c| c.replace(0)))
}