pub struct FutexWakeCount(/* private fields */);Expand description
Nombre de waiters à réveiller par futex_wake (val de FUTEX_WAKE).
Le val de FUTEX_WAKE est interprété comme un int (signé 32 bits) par le
noyau : seules les valeurs [0, INT_MAX] ont un sens. Ce newtype borne par
construction (« parse, don’t validate », Principe 4) la valeur à
INT_MAX (0x7fff_ffff) — FutexWakeCount::new clampe toute valeur plus
grande. Le wrapper syscall n’a donc jamais à gérer une conversion qui échoue.
Réveiller INT_MAX waiters équivaut à « réveiller tous les waiters » :
c’est l’idiome FutexWakeCount::ALL.
Implementations§
Source§impl FutexWakeCount
impl FutexWakeCount
Sourcepub const ALL: Self
pub const ALL: Self
Réveille tous les waiters (valeur noyau INT_MAX) — le cas d’un
Condvar::notify_all ou d’un barrage qui s’ouvre.
Trait Implementations§
Source§impl Clone for FutexWakeCount
impl Clone for FutexWakeCount
Source§fn clone(&self) -> FutexWakeCount
fn clone(&self) -> FutexWakeCount
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FutexWakeCount
Source§impl Debug for FutexWakeCount
impl Debug for FutexWakeCount
impl Eq for FutexWakeCount
Source§impl Hash for FutexWakeCount
impl Hash for FutexWakeCount
Source§impl Ord for FutexWakeCount
impl Ord for FutexWakeCount
Source§fn cmp(&self, other: &FutexWakeCount) -> Ordering
fn cmp(&self, other: &FutexWakeCount) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FutexWakeCount
impl PartialEq for FutexWakeCount
Source§impl PartialOrd for FutexWakeCount
impl PartialOrd for FutexWakeCount
impl StructuralPartialEq for FutexWakeCount
Auto Trait Implementations§
impl Freeze for FutexWakeCount
impl RefUnwindSafe for FutexWakeCount
impl Send for FutexWakeCount
impl Sync for FutexWakeCount
impl Unpin for FutexWakeCount
impl UnsafeUnpin for FutexWakeCount
impl UnwindSafe for FutexWakeCount
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