#[cfg(not(feature = "async"))]
fn main() {
use synchronized::{sync, sync_point};
sync_point! {COMB_SYNC (String = String::new(), usize = 0) {
static mut POINT: usize = 0;
let result0 = sync!((->COMB_SYNC) {
unsafe {
POINT += 1;
POINT
}
});
println!("Unsynchronized code 1");
let result1 = sync!(->COMB_SYNC(sync_let, count) {
*sync_let = "test".to_string();
*count += 1;
*count
});
println!("Unsynchronized code 2");
let result2 = sync!((->COMB_SYNC) {
unsafe {
POINT += 1;
POINT
}
});
println!("result, res0: {:?}, res1: {:?}, res2: {:?}", result0, result1, result2);
}}
}
#[cfg(feature = "async")]
fn main() {
println!("This example only builds and runs with --feature=\"sync\"");
}