pub(crate) struct GlobalData {
pub(crate) data: HalfLock<SignalData>,
pub(crate) race_fallback: HalfLock<Option<Prev>>,
}
Expand description
Lazy-initiated data structure with our global variables.
Used inside a structure to cut down on boilerplate code to lazy-initialize stuff. We don’t dare use anything fancy like lazy-static or once-cell, since we are not sure they are async-signal-safe in their access. Our code uses the Once, but only on the write end outside of signal handler. The handler assumes it has already been initialized.
Fields§
§data: HalfLock<SignalData>
The data structure describing what needs to be run for each signal.
race_fallback: HalfLock<Option<Prev>>
A fallback to fight/minimize a race condition during signal initialization.
See the comment inside register_unchecked_impl
.
Implementations§
Auto Trait Implementations§
impl !Freeze for GlobalData
impl !RefUnwindSafe for GlobalData
impl Send for GlobalData
impl Sync for GlobalData
impl Unpin for GlobalData
impl !UnwindSafe for GlobalData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more