mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-27 03:13:23 +00:00
Make atomic mode panics have clear messages
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
065a3bd1c3
commit
969ac97144
@ -32,6 +32,7 @@ pub trait Pause: WaitTimeout {
|
||||
/// condition is met.
|
||||
///
|
||||
/// [`EINTR`]: crate::error::Errno::EINTR
|
||||
#[track_caller]
|
||||
fn pause_until<F, R>(&self, cond: F) -> Result<R>
|
||||
where
|
||||
F: FnMut() -> Option<R>,
|
||||
@ -49,6 +50,7 @@ pub trait Pause: WaitTimeout {
|
||||
///
|
||||
/// [`ETIME`]: crate::error::Errno::ETIME
|
||||
/// [`EINTR`]: crate::error::Errno::EINTR
|
||||
#[track_caller]
|
||||
fn pause_until_or_timeout<'a, F, T, R>(&self, mut cond: F, timeout: T) -> Result<R>
|
||||
where
|
||||
F: FnMut() -> Option<R>,
|
||||
@ -74,6 +76,7 @@ pub trait Pause: WaitTimeout {
|
||||
/// [`ETIME`]: crate::error::Errno::ETIME
|
||||
/// [`EINTR`]: crate::error::Errno::EINTR
|
||||
#[doc(hidden)]
|
||||
#[track_caller]
|
||||
fn pause_until_or_timeout_impl<F, R>(
|
||||
&self,
|
||||
cond: F,
|
||||
@ -94,6 +97,7 @@ pub trait Pause: WaitTimeout {
|
||||
///
|
||||
/// [`ETIME`]: crate::error::Errno::ETIME
|
||||
/// [`EINTR`]: crate::error::Errno::EINTR
|
||||
#[track_caller]
|
||||
fn pause_timeout<'a>(&self, timeout: impl Into<TimeoutExt<'a>>) -> Result<()>;
|
||||
}
|
||||
|
||||
|
@ -368,6 +368,7 @@ pub trait Pollable {
|
||||
/// The user must ensure that a call to `try_op()` does not fail with `EAGAIN` when the
|
||||
/// interesting events occur. However, it is allowed to have spurious `EAGAIN` failures due to
|
||||
/// race opitions where the events are consumed by another thread.
|
||||
#[track_caller]
|
||||
fn wait_events<F, R>(
|
||||
&self,
|
||||
mask: IoEvents,
|
||||
|
Reference in New Issue
Block a user