[WIP] fix deadlock in AtomTable::build_with

This commit is contained in:
Bennet Bleßmann
2023-08-28 23:04:30 +02:00
parent 86166dbf25
commit 13cbff7eab
24 changed files with 295 additions and 413 deletions

View File

@@ -70,11 +70,13 @@ impl Completer for Helper {
if let Some(idx) = start_of_prefix {
let sub_str = line.get(idx..pos).unwrap();
let guard = tokio::runtime::Handle::current()
.block_on(self.atoms.upgrade().unwrap().read_owned());
let atom_table = self.atoms.upgrade().unwrap();
println!("locking atom table to load completions");
let guard = atom_table.blocking_read();
let mut matching = guard
.table
.blocking_read()
.iter()
.chain(STATIC_ATOMS_MAP.values())
.map(|a| a.as_str())