[WIP] fix deadlock in AtomTable::build_with
This commit is contained in:
@@ -1076,7 +1076,7 @@ impl<'a, LS: LoadState<'a>> Loader<'a, LS> {
|
||||
|
||||
let export_list = machine_st.read_term_from_heap(cell)?;
|
||||
let atom_tbl = &mut LS::machine_st(&mut self.payload).atom_tbl;
|
||||
let export_list = setup_module_export_list(export_list, &mut atom_tbl.blocking_write())?;
|
||||
let export_list = setup_module_export_list(export_list, &atom_tbl)?;
|
||||
|
||||
Ok(export_list.into_iter().collect())
|
||||
}
|
||||
@@ -1420,7 +1420,7 @@ impl MachineState {
|
||||
term_stack.push(Term::PartialString(Cell::default(), string, tail));
|
||||
}
|
||||
Ok((string, None)) => {
|
||||
let atom = self.atom_tbl.blocking_write().build_with(&string);
|
||||
let atom = AtomTable::build_with(&self.atom_tbl, &string);
|
||||
term_stack.push(Term::CompleteString(Cell::default(), atom));
|
||||
}
|
||||
Err(cons_term) => term_stack.push(cons_term),
|
||||
@@ -1917,11 +1917,7 @@ impl Machine {
|
||||
pub(crate) fn load_context_source(&mut self) {
|
||||
if let Some(load_context) = self.load_contexts.last() {
|
||||
let path_str = load_context.path.to_str().unwrap();
|
||||
let path_atom = self
|
||||
.machine_st
|
||||
.atom_tbl
|
||||
.blocking_write()
|
||||
.build_with(path_str);
|
||||
let path_atom = AtomTable::build_with(&self.machine_st.atom_tbl, path_str);
|
||||
|
||||
self.machine_st
|
||||
.unify_atom(path_atom, self.machine_st.registers[1]);
|
||||
@@ -1935,11 +1931,8 @@ impl Machine {
|
||||
match load_context.path.file_name() {
|
||||
Some(file_name) if load_context.path.is_file() => {
|
||||
let file_name_str = file_name.to_str().unwrap();
|
||||
let file_name_atom = self
|
||||
.machine_st
|
||||
.atom_tbl
|
||||
.blocking_write()
|
||||
.build_with(file_name_str);
|
||||
let file_name_atom =
|
||||
AtomTable::build_with(&self.machine_st.atom_tbl, file_name_str);
|
||||
|
||||
self.machine_st
|
||||
.unify_atom(file_name_atom, self.machine_st.registers[1]);
|
||||
@@ -1958,11 +1951,8 @@ impl Machine {
|
||||
if let Some(load_context) = self.load_contexts.last() {
|
||||
if let Some(directory) = load_context.path.parent() {
|
||||
let directory_str = directory.to_str().unwrap();
|
||||
let directory_atom = self
|
||||
.machine_st
|
||||
.atom_tbl
|
||||
.blocking_write()
|
||||
.build_with(directory_str);
|
||||
let directory_atom =
|
||||
AtomTable::build_with(&self.machine_st.atom_tbl, directory_str);
|
||||
|
||||
self.machine_st
|
||||
.unify_atom(directory_atom, self.machine_st.registers[1]);
|
||||
|
||||
Reference in New Issue
Block a user