wasmer_vm/interrupt_registry/
mod.rs1use thiserror::Error;
11use wasmer_types::StoreId;
12
13#[cfg(unix)]
14mod unix;
15#[cfg(unix)]
16pub use unix::*;
17
18#[cfg(not(unix))]
21mod unsupported;
22#[cfg(not(unix))]
23pub use unsupported::*;
24
25#[derive(Debug, Error)]
26#[allow(missing_docs)]
27pub enum InstallError {
28 #[error("This store was already interrupted and can't be entered again")]
29 AlreadyInterrupted,
30}
31
32#[derive(Debug, Error)]
33#[allow(missing_docs)]
34pub enum InterruptError {
35 #[error("Store not running")]
36 StoreNotRunning,
37 #[error("Another interrupt is already in progress on the target thread")]
38 OtherInterruptInProgress,
39 #[error("Failed to send interrupt signal due to OS error: {0}")]
40 FailedToSendSignal(&'static str),
41}
42
43pub struct InterruptInstallGuard {
45 store_id: StoreId,
46}
47
48impl Drop for InterruptInstallGuard {
49 fn drop(&mut self) {
50 let store_id = self.store_id;
51 uninstall(store_id);
52 }
53}