use thiserror::Error;
use wasmer_types::StoreId;
#[cfg(unix)]
mod unix;
#[cfg(unix)]
pub use unix::*;
#[cfg(not(unix))]
mod unsupported;
#[cfg(not(unix))]
pub use unsupported::*;
#[derive(Debug, Error)]
#[allow(missing_docs)]
pub enum InstallError {
#[error("This store was already interrupted and can't be entered again")]
AlreadyInterrupted,
}
#[derive(Debug, Error)]
#[allow(missing_docs)]
pub enum InterruptError {
#[error("Store not running")]
StoreNotRunning,
#[error("Another interrupt is already in progress on the target thread")]
OtherInterruptInProgress,
#[error("Failed to send interrupt signal due to OS error: {0}")]
FailedToSendSignal(&'static str),
}
pub struct InterruptInstallGuard {
store_id: StoreId,
}
impl Drop for InterruptInstallGuard {
fn drop(&mut self) {
let store_id = self.store_id;
uninstall(store_id);
}
}