mirror of
https://github.com/lune-org/lune.git
synced 2025-04-10 21:40:54 +01:00
make cache arc mutex
This commit is contained in:
parent
cbd7cb6480
commit
16b3cde97e
1 changed files with 3 additions and 2 deletions
|
@ -1,13 +1,14 @@
|
||||||
use crate::{library::StandardLibrary, luaurc::RequireAlias};
|
use crate::{library::StandardLibrary, luaurc::RequireAlias};
|
||||||
use mlua::prelude::*;
|
use mlua::prelude::*;
|
||||||
use std::collections::HashMap;
|
use std::{collections::HashMap, sync::Arc};
|
||||||
|
use tokio::sync::Mutex;
|
||||||
|
|
||||||
/// The private struct that's stored in mlua's app data container
|
/// The private struct that's stored in mlua's app data container
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
struct RequireContextData<'a> {
|
struct RequireContextData<'a> {
|
||||||
std: HashMap<&'a str, HashMap<&'a str, Box<dyn StandardLibrary>>>,
|
std: HashMap<&'a str, HashMap<&'a str, Box<dyn StandardLibrary>>>,
|
||||||
std_cache: HashMap<RequireAlias, LuaRegistryKey>,
|
std_cache: HashMap<RequireAlias, LuaRegistryKey>,
|
||||||
cache: HashMap<&'a str, LuaRegistryKey>,
|
cache: Arc<Mutex<HashMap<&'a str, LuaRegistryKey>>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
Loading…
Add table
Reference in a new issue