pub struct Notifier(/* private fields */);Implementations§
Source§impl Notifier
impl Notifier
Sourcepub unsafe fn notify(&self, notification: NonZeroU32) -> (bool, bool)
pub unsafe fn notify(&self, notification: NonZeroU32) -> (bool, bool)
§Safety
This method is unsafe because it is possible to call core::mem::forget on the Monitor instance
that produced this notifier.
If that happens, the Drop dtor of Monitor will NOT be called, which - in turn - means that the
Arc holding the task reference will stick around even when the actual task where the Monitor instance was
created no longer exists. Which - in turn - would mean that the method will be trying to notify a task
which does no longer exist, which would lead to UB and specifically - to memory corruption.
Sourcepub unsafe fn notify_and_yield(&self, notification: NonZeroU32) -> bool
pub unsafe fn notify_and_yield(&self, notification: NonZeroU32) -> bool
§Safety
This method is unsafe because it is possible to call core::mem::forget on the Monitor instance
that produced this notifier.
If that happens, the Drop dtor of Monitor will NOT be called, which - in turn - means that the
Arc holding the task reference will stick around even when the actual task where the Monitor instance was
created no longer exists. Which - in turn - would mean that the method will be trying to notify a task
which does no longer exist, which would lead to UB and specifically - to memory corruption.