font_index/util/
atomic.rs1use std::sync::atomic::{AtomicU64, Ordering};
2
3pub struct AtomicCounter(AtomicU64);
4
5impl AtomicCounter {
6 pub const fn new() -> Self {
7 Self(AtomicU64::new(1))
8 }
9
10 pub fn next(&self) -> u64 {
11 self.0.fetch_add(1, Ordering::Relaxed)
12 }
13}