Switch from Rc<RefCell> to Arc<Mutex<T>> or Arc<ReentrantMutex<RefCell<T>>>.
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
@@ -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() {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user