Struct esp_idf_svc::hal::task::notification::Notifier
source · pub struct Notifier(/* private fields */);
Implementations§
source§impl Notifier
impl Notifier
sourcepub unsafe fn notify(&self, notification: NonZero<u32>) -> (bool, bool)
pub unsafe fn notify(&self, notification: NonZero<u32>) -> (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: NonZero<u32>) -> bool
pub unsafe fn notify_and_yield(&self, notification: NonZero<u32>) -> 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.