pub struct Notification {
id: u64,
word: AtomicU64,
waitq: WaitQueue,
bound: SpinLock<Option<Arc<Endpoint>>>,
_charge: Option<IpcCharge>,
}Expand description
A 64-bit OR-coalescing signal word with an optional endpoint binding.
Fields§
§id: u64§word: AtomicU64§waitq: WaitQueue§bound: SpinLock<Option<Arc<Endpoint>>>§_charge: Option<IpcCharge>Creator-silo notification count (§12), released with the object.
Implementations§
Source§impl Notification
impl Notification
Sourcepub fn create() -> Arc<Notification> ⓘ
pub fn create() -> Arc<Notification> ⓘ
Create an uncharged notification (kernel-internal use).
Sourcepub fn create_charged(charge: Option<IpcCharge>) -> Arc<Notification> ⓘ
pub fn create_charged(charge: Option<IpcCharge>) -> Arc<Notification> ⓘ
Create a notification paid for by charge.
Sourcepub fn signal(&self, bits: u64) -> Result<(), SyscallError>
pub fn signal(&self, bits: u64) -> Result<(), SyscallError>
Signal bits: OR into the word and raise the bound endpoint’s pending
bits. bits is already masked by the caller (handle badge).
Sourcepub fn take(&self) -> Option<u64>
pub fn take(&self) -> Option<u64>
Non-blocking read-and-clear (async path); None when no bit is set.
Sourcepub fn wait(
&self,
nonblock: bool,
deadline_ns: Option<u64>,
) -> Result<u64, SyscallError>
pub fn wait( &self, nonblock: bool, deadline_ns: Option<u64>, ) -> Result<u64, SyscallError>
Wait for non-zero bits, atomically read and clear them.
deadline_ns (absolute, crate::sync::scheduler_clock_ns) bounds the
whole wait, including retries after another waiter took the bits.
Auto Trait Implementations§
impl !Freeze for Notification
impl !RefUnwindSafe for Notification
impl !UnwindSafe for Notification
impl Forget for Notification
impl Move for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnsafeUnpin for Notification
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more