pub enum FutexScope {
Private,
Shared,
}Expand description
Portée d’une opération futex(2) : process-privée ou partagée.
Le noyau distingue deux familles de futex via le drapeau FUTEX_PRIVATE_FLAG :
FutexScope::Private(FUTEX_*_PRIVATE) — le cas courant, et le défaut (Default). Le futex n’est partagé qu’entre les threads d’un même processus ; le noyau saute la résolution d’adresse inter-process (clé futex basée sur l’adresse virtuelle, pas sur l’inode du mapping) — c’est strictement plus rapide. C’est la portée d’unMutex/Condvarintra-processus.FutexScope::Shared— le mot futex vit dans de la mémoire partagée (mmap(MAP_SHARED), segment SysV…) et synchronise des processus distincts. Le noyau identifie le futex par l’inode + offset du mapping sous-jacent.
Exposer la portée comme un type (et non un drapeau d’op brut) respecte
ADR-021 §3 : futex_wait/futex_wake restent une fonction typée par
opération, la portée est un paramètre typé orthogonal.
Variants§
Private
Futex process-privé (FUTEX_*_PRIVATE) — défaut, cas courant.
Futex partagé entre processus (mémoire MAP_SHARED).
Trait Implementations§
Source§impl Clone for FutexScope
impl Clone for FutexScope
Source§fn clone(&self) -> FutexScope
fn clone(&self) -> FutexScope
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 FutexScope
Source§impl Debug for FutexScope
impl Debug for FutexScope
Source§impl Default for FutexScope
impl Default for FutexScope
Source§fn default() -> FutexScope
fn default() -> FutexScope
Returns the “default value” for a type. Read more
impl Eq for FutexScope
Source§impl Hash for FutexScope
impl Hash for FutexScope
Source§impl PartialEq for FutexScope
impl PartialEq for FutexScope
impl StructuralPartialEq for FutexScope
Auto Trait Implementations§
impl Freeze for FutexScope
impl RefUnwindSafe for FutexScope
impl Send for FutexScope
impl Sync for FutexScope
impl Unpin for FutexScope
impl UnsafeUnpin for FutexScope
impl UnwindSafe for FutexScope
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