[WIP] fix deadlock in AtomTable::build_with
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user