Switch from Rc<RefCell> to Arc<Mutex<T>> or Arc<ReentrantMutex<RefCell<T>>>.

This commit is contained in:
Oleksandr Kozachuk
2023-01-06 13:12:58 +01:00
parent a2978c1230
commit 538a32a471
13 changed files with 384 additions and 214 deletions
+6
View File
@@ -0,0 +1,6 @@
use hel::lk::LK;
use std::sync::{Arc, Mutex};
lazy_static! {
static ref STATE: Arc<Mutex<LK>> = Arc::new(Mutex::new(LK::new()));
}
+8
View File
@@ -1,3 +1,5 @@
#[macro_use]
extern crate lazy_static;
extern crate hel;
use wasm_bindgen::prelude::*;
@@ -6,3 +8,9 @@ use wasm_bindgen::prelude::*;
pub fn ok_add(a: i32, b: i32) -> i32 {
a + b + 1
}
mod hel_state;
#[wasm_bindgen]
pub fn hel_init() {
}