use indexmap::IndexMap;
+use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::fmt;
use std::ops::{Index, IndexMut, Range};
+use std::process::Child;
use std::sync::Arc;
pub(crate) type Registers = [HeapCellValue; MAX_ARITY + 1];
pub(crate) unify_fn: fn(&mut MachineState),
pub(crate) bind_fn: fn(&mut MachineState, Ref, HeapCellValue),
pub(crate) run_cleaners_fn: fn(&mut Machine) -> bool,
+ pub(crate) child_processes: BTreeMap<u32, Child>,
}
impl fmt::Debug for MachineState {
use indexmap::IndexSet;
use std::cmp::Ordering;
+use std::collections::BTreeMap;
use std::convert::TryFrom;
impl MachineState {
unify_fn: MachineState::unify,
bind_fn: MachineState::bind,
run_cleaners_fn: |_| false,
+ child_processes: BTreeMap::new(),
}
}
match command.spawn() {
Ok(child) => {
let pid = child.id();
+
+ self.machine_st.child_processes.insert(pid, child);
+
self.machine_st.bind(
pid_r
.as_var()
.expect("invalid values should have been rejected on the prolog side"),
fixnum_as_cell!(Fixnum::build_with(pid)),
);
+
Ok(())
}
Err(_) => {