preemptive_threads/signal_safe.rs
1/// Signal-safe preemption handler
2///
3/// This module provides backward compatibility with the old signal-based API.
4/// For new code, prefer using `crate::platform_timer` directly.
5// Re-export the platform timer functions for backward compatibility
6pub use crate::platform_timer::{
7 clear_preemption_pending, get_preemption_count, is_preemption_pending, preemption_checkpoint,
8};
9
10#[cfg(target_os = "linux")]
11pub use crate::platform_timer::signal_safe_handler;
12
13/// Initialize signal-safe preemption (backward compatibility)
14pub fn init_signal_safe_preemption(interval_ms: u64) -> Result<(), &'static str> {
15 crate::platform_timer::init_preemption_timer(interval_ms)
16}
17
18/// Stop preemption timer (backward compatibility)
19pub fn stop_preemption() {
20 crate::platform_timer::stop_preemption_timer();
21}