Fix breakage from #56988 and workaround for #57569

This commit is contained in:
Vardhan Thigle 2019-01-09 13:53:46 +05:30
parent 4a957b320d
commit 99fbd1bf11
2 changed files with 9 additions and 0 deletions

View file

@ -25,6 +25,14 @@ impl Instant {
pub fn checked_sub_duration(&self, other: &Duration) -> Option<Instant> {
Some(Instant(self.0.checked_sub(*other)?))
}
pub fn actually_monotonic() -> bool {
false
}
pub const fn zero() -> Instant {
Instant(Duration::from_secs(0))
}
}
impl SystemTime {

View file

@ -456,6 +456,7 @@ mod spin_mutex {
}
}
/// Lock the Mutex or return false.
pub macro try_lock_or_false {
($e:expr) => {
if let Some(v) = $e.try_lock() {