[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

@@ -16,6 +16,8 @@ use fxhash::FxBuildHasher;
use indexmap::{IndexMap, IndexSet};
use ordered_float::OrderedFloat;
use tokio::sync::RwLock;
use std::cell::Cell;
use std::collections::VecDeque;
use std::convert::TryFrom;
@@ -481,10 +483,10 @@ pub enum AtomOrString {
impl AtomOrString {
#[inline]
pub fn as_atom(&self, atom_tbl: &mut AtomTable) -> Atom {
pub fn as_atom(&self, atom_tbl: &RwLock<AtomTable>) -> Atom {
match self {
&AtomOrString::Atom(atom) => atom,
AtomOrString::String(string) => atom_tbl.build_with(&string),
AtomOrString::String(string) => AtomTable::build_with(atom_tbl, &string),
}
}