pub use ctrlc;
pub use futex_queue as mpsc;
pub use lazy_static;
pub use linux_rtic_macros::app;
pub use pcp_mutex::PcpMutex;
pub use rtic_core::{prelude as mutex_prelude, Exclusive, Mutex};
use std::cell::UnsafeCell;
#[cfg(feature = "profiling")]
pub use tracing;
#[cfg(feature = "profiling")]
pub use tracing_chrome;
#[cfg(feature = "profiling")]
pub use tracing_subscriber;
pub mod slab;
pub fn init_thread_state(priority: pcp_mutex::Priority) {
#[cfg(feature = "rt")]
pcp_mutex::thread::init_fifo_priority(priority).expect("Error setting thread priority");
}
#[repr(transparent)]
pub struct RacyCell<T>(UnsafeCell<T>);
impl<T> RacyCell<T> {
#[inline(always)]
pub const fn new(value: T) -> Self {
RacyCell(UnsafeCell::new(value))
}
#[inline(always)]
pub unsafe fn get_mut_unchecked(&self) -> &mut T {
&mut *self.0.get()
}
#[inline(always)]
pub unsafe fn get_unchecked(&self) -> &T {
&*self.0.get()
}
}
unsafe impl<T> Sync for RacyCell<T> {}