Add TimedOut::timed_out

This commit is contained in:
Steven Fackler 2015-08-14 20:35:33 -07:00
parent 42a386fcf8
commit 46156de5f1

View file

@ -20,7 +20,7 @@ use time::Duration;
/// A type indicating whether a timed wait on a condition variable returned
/// due to a time out or not.
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, PartialEq, Eq, Copy, Clone)]
#[unstable(feature = "wait_timeout", reason = "newly added")]
pub enum TimedOut {
/// The wait timed out.
@ -29,6 +29,13 @@ pub enum TimedOut {
No
}
impl TimedOut {
/// Returns `true` iff the value of `self` is `Yes`.
pub fn timed_out(&self) -> bool {
*self == TimedOut::Yes
}
}
/// A Condition Variable
///
/// Condition variables represent the ability to block a thread such that it