Remove pender-callback

This commit is contained in:
Dániel Buga
2023-08-14 08:32:26 +02:00
parent ec6bd27df6
commit 454a7cbf4c
2 changed files with 2 additions and 24 deletions

View File

@ -317,28 +317,11 @@ pub enum Pender {
/// Pender for an interrupt-mode executor.
#[cfg(feature = "executor-interrupt")]
Interrupt(OpaqueInterruptContext),
/// Arbitrary, dynamically dispatched pender.
#[cfg(feature = "pender-callback")]
Callback { func: fn(*mut ()), context: *mut () },
}
unsafe impl Send for Pender {}
unsafe impl Sync for Pender {}
impl Pender {
/// Create a `Pender` that will call an arbitrary function pointer.
///
/// # Arguments
///
/// - `func`: The function pointer to call.
/// - `context`: Opaque context pointer, that will be passed to the function pointer.
#[cfg(feature = "pender-callback")]
pub fn new_from_callback(func: fn(*mut ()), context: *mut ()) -> Self {
Self::Callback { func, context }
}
}
impl Pender {
pub(crate) fn pend(self) {
match self {
@ -356,8 +339,6 @@ impl Pender {
}
unsafe { __interrupt_mode_pender(interrupt) };
}
#[cfg(feature = "pender-callback")]
Pender::Callback { func, context } => func(context),
}
}
}