Add TimedOut::timed_out
This commit is contained in:
parent
42a386fcf8
commit
46156de5f1
1 changed files with 8 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue