pub mod bridge;
pub mod driver;
pub mod vm_driver;
pub mod channel;
pub mod classify;
pub mod fec;
pub mod marshal;
pub mod model;
pub(crate) mod net_inbox;
pub mod pnp;
pub mod send_check;
pub mod stream;
use crate::ast::stmt::Stmt;
pub fn uses_scheduler(stmts: &[Stmt]) -> bool {
stmts.iter().any(stmt_uses_scheduler)
}
fn stmt_uses_scheduler(s: &Stmt) -> bool {
match s {
Stmt::LaunchTask { .. }
| Stmt::LaunchTaskWithHandle { .. }
| Stmt::CreatePipe { .. }
| Stmt::SendPipe { .. }
| Stmt::ReceivePipe { .. }
| Stmt::TrySendPipe { .. }
| Stmt::TryReceivePipe { .. }
| Stmt::Select { .. }
| Stmt::StopTask { .. } => true,
Stmt::If { then_block, else_block, .. } => {
then_block.iter().any(stmt_uses_scheduler)
|| else_block.map_or(false, |b| b.iter().any(stmt_uses_scheduler))
}
Stmt::While { body, .. }
| Stmt::Repeat { body, .. }
| Stmt::Zone { body, .. }
| Stmt::FunctionDef { body, .. } => body.iter().any(stmt_uses_scheduler),
Stmt::Concurrent { tasks } | Stmt::Parallel { tasks } => {
tasks.iter().any(stmt_uses_scheduler)
}
Stmt::Inspect { arms, .. } => {
arms.iter().any(|a| a.body.iter().any(stmt_uses_scheduler))
}
_ => false,
}
}
pub use classify::{branches_independent, branches_share_mutable_state, classify_program};
pub use marshal::{materialize, rebuild, MarshalError};
pub use model::{Determinacy, NondetKind, NondetWitness};
pub use net_inbox::{net_is_offline, set_net_offline};
pub use send_check::{check_send_escape, SendDiagnostic};