pub enum CondvarWaitError {
TimedOut,
Invalid,
Permission,
OwnerDead,
NotRecoverable,
Other(i32),
}Expand description
The error type returned from a wait or a timed wait on a condvar.
The variant descriptions and Display impls for this error type are based on info from the
POSIX man pages. The semantics, however, are platform-dependent. Consult the man pages of your
operating system for more relevant error descriptions.
Variants§
TimedOut
The deadline of a timed wait passed before the condvar was notified. The timed waits here
report that outcome as WaitOutcome::TimedOut, so this
variant only shows up when a raw errno is converted by hand.
Invalid
This error can occur for several reasons:
- The deadline’s nanosecond value was out of range. This is the only case POSIX requires reporting.
- The condvar or the mutex does not refer to an initialised object, or concurrent waits on the same condvar were passed guards belonging to different mutexes. POSIX recommends rather than requires reporting these, so whether they are detected is up to the platform.
Permission
The mutex is error-checking or robust and the calling thread does not own it. The waits in this crate take a guard, which is proof of ownership, so this variant only shows up when a raw errno is converted by hand.
OwnerDead
The mutex is robust and its previous owner terminated while holding the lock. The wait
nevertheless returned with the mutex locked, so the guard is still good: repair the data
it protects and call mark_consistent on it, or every later lock will fail with
NotRecoverable.
NotRecoverable
The mutex is robust, its previous owner died holding the lock, and nobody marked the data consistent afterwards.
Other(i32)
None of the above. Contains the libc error code.
Trait Implementations§
Source§impl Clone for CondvarWaitError
impl Clone for CondvarWaitError
Source§fn clone(&self) -> CondvarWaitError
fn clone(&self) -> CondvarWaitError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CondvarWaitError
Source§impl Debug for CondvarWaitError
impl Debug for CondvarWaitError
Source§impl Display for CondvarWaitError
impl Display for CondvarWaitError
impl Eq for CondvarWaitError
Source§impl Error for CondvarWaitError
impl Error for CondvarWaitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()