pub struct WaitSet { /* private fields */ }Expand description
WaitSet — Spec §2.2.2.1.6.
Ein WaitSet sammelt 0..N Arc<dyn Condition> und blockiert in
Self::wait bis mindestens eine triggert oder ein Timeout
erreicht wird. Liefert die Liste der getriggerten Conditions
zurueck.
Implementations§
Source§impl WaitSet
impl WaitSet
Sourcepub fn attach_condition(&self, cond: Arc<dyn Condition>) -> Result<()>
pub fn attach_condition(&self, cond: Arc<dyn Condition>) -> Result<()>
Haengt eine Condition an. Spec §2.2.2.1.6 attach_condition.
§Errors
PreconditionNotMet wenn der interne Lock vergiftet ist.
Sourcepub fn detach_condition(&self, cond: &Arc<dyn Condition>) -> Result<()>
pub fn detach_condition(&self, cond: &Arc<dyn Condition>) -> Result<()>
Loest eine Condition. Spec §2.2.2.1.6 detach_condition.
§Errors
PreconditionNotMet wenn der interne Lock vergiftet ist.
Sourcepub fn wait(&self, timeout: Duration) -> Result<Vec<Arc<dyn Condition>>>
pub fn wait(&self, timeout: Duration) -> Result<Vec<Arc<dyn Condition>>>
Blockiert bis mindestens eine Condition triggert oder das
Timeout abgelaufen ist. Liefert die Liste der getriggerten
Conditions. Spec §2.2.2.1.6 wait.
Implementation: Polling mit 1ms Intervall. Production-grade WaitSet wuerde Conditions Notify-Hooks anbieten; das ist Folge- Optimierung in .
§Errors
DdsError::Timeoutwenn keine Condition innerhalb des Timeouts triggert.DdsError::PreconditionNotMetbei Lock-Poisoning.
Sourcepub fn notify(&self)
pub fn notify(&self)
Weckt einen blockierten wait() ohne dass ein
trigger_value-Wechsel passiert ist (z.B. fuer Shutdown).
Aktuell hat das nur Effekt, wenn der WaitSet
gerade in wait_timeout haengt — Caller sollte trotzdem eine
GuardCondition anhaengen, damit der wakeup ein definites
Ergebnis hat.