This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn init() { | |
static INIT_ONCE: std::sync::Once = std::sync::Once::new(); | |
INIT_ONCE.call_once(|| { | |
let mut zero__2 = 0; | |
{ | |
*ZERO__2.write().unwrap() = Some(zero__2); | |
} | |
zero__2 = zero__2; | |
{ | |
*ZERO__2.write().unwrap() = Some(zero__2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::sync::{Arc, LockResult, Mutex, MutexGuard}; | |
use std::thread; | |
struct SharedDataStruct { | |
value: i32, | |
} | |
trait SharedData { | |
fn get_value(&self) -> i32; | |
fn set_value(&mut self, new_value: i32); |