]> git.lizzy.rs Git - rust.git/commitdiff
Fix breakage from #56988 and workaround for #57569
authorVardhan Thigle <vardhan.thigle@fortanix.com>
Wed, 9 Jan 2019 08:23:46 +0000 (13:53 +0530)
committerVardhan Thigle <vardhan.thigle@fortanix.com>
Sun, 13 Jan 2019 07:37:45 +0000 (13:07 +0530)
src/libstd/sys/sgx/time.rs
src/libstd/sys/sgx/waitqueue.rs

index 10fe72d5f686954378f19fa7451aa27439fba7e1..407fe72b0e62354b8a9af49c93cbb7a0f51a1024 100644 (file)
@@ -25,6 +25,14 @@ pub fn checked_add_duration(&self, other: &Duration) -> Option<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 {
index a47382087782d6945b53b336d7142369cecb4822..51c00a1433e76a78181d7d6199be7cf22531cad0 100644 (file)
@@ -456,6 +456,7 @@ pub fn try_lock(&self) -> Option<SpinMutexGuard<T>> {
         }
     }
 
+    /// Lock the Mutex or return false.
     pub macro try_lock_or_false {
         ($e:expr) => {
             if let Some(v) = $e.try_lock() {