crb_agent/
global.rs

1use core::sync::atomic::{AtomicUsize, Ordering};
2
3pub static CRB: Global = Global::new();
4
5pub struct Global {
6    long_threshold: AtomicUsize,
7}
8
9impl Global {
10    const fn new() -> Self {
11        Self {
12            long_threshold: AtomicUsize::new(usize::MAX),
13        }
14    }
15
16    pub fn set_long_threshold(&self, ms: usize) {
17        self.long_threshold.store(ms, Ordering::Relaxed);
18    }
19
20    pub fn get_long_threshold(&self) -> usize {
21        self.long_threshold.load(Ordering::Relaxed)
22    }
23}