]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/sgx/rwlock.rs
SGX target: convert a bunch of panics to aborts
[rust.git] / src / libstd / sys / sgx / rwlock.rs
index 784303f3a65e8d4f3f630e5c16588a309cf614d2..09b5ffb199676d07464b7113daeb09d080517a9b 100644 (file)
@@ -93,8 +93,8 @@ pub unsafe fn try_write(&self) -> bool {
     #[inline]
     unsafe fn __read_unlock(
         &self,
-        mut rguard: SpinMutexGuard<WaitVariable<Option<NonZeroUsize>>>,
-        wguard: SpinMutexGuard<WaitVariable<bool>>,
+        mut rguard: SpinMutexGuard<'_, WaitVariable<Option<NonZeroUsize>>>,
+        wguard: SpinMutexGuard<'_, WaitVariable<bool>>,
     ) {
         *rguard.lock_var_mut() = NonZeroUsize::new(rguard.lock_var().unwrap().get() - 1);
         if rguard.lock_var().is_some() {
@@ -105,7 +105,7 @@ unsafe fn __read_unlock(
                 *wguard.lock_var_mut() = true;
             } else {
                 // No writers were waiting, the lock is released
-                assert!(rguard.queue_empty());
+                rtassert!(rguard.queue_empty());
             }
         }
     }
@@ -120,8 +120,8 @@ pub unsafe fn read_unlock(&self) {
     #[inline]
     unsafe fn __write_unlock(
         &self,
-        rguard: SpinMutexGuard<WaitVariable<Option<NonZeroUsize>>>,
-        wguard: SpinMutexGuard<WaitVariable<bool>>,
+        rguard: SpinMutexGuard<'_, WaitVariable<Option<NonZeroUsize>>>,
+        wguard: SpinMutexGuard<'_, WaitVariable<bool>>,
     ) {
         if let Err(mut wguard) = WaitQueue::notify_one(wguard) {
             // No writers waiting, release the write lock