comparison src/t16thread/src/main.rs @ 10:7eb649571bc6

add async example
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 18 Jan 2021 13:22:06 +0900
parents aaba40049c28
children 70ab6c2f7f6e
comparison
equal deleted inserted replaced
9:aaba40049c28 10:7eb649571bc6
26 for i in 1..5 { 26 for i in 1..5 {
27 println!("hi number {} from the main thread!", i); 27 println!("hi number {} from the main thread!", i);
28 thread::sleep(Duration::from_millis(1)); 28 thread::sleep(Duration::from_millis(1));
29 } 29 }
30 handle.join().unwrap(); // without this, some data are dropped 30 handle.join().unwrap(); // without this, some data are dropped
31 // main1(); 31 main1();
32 // t16thread::mpsc_test::mainm(); 32 t16thread::mpsc_test::mainm();
33 // t16thread::mpsc_test::mainc(); 33 t16thread::mpsc_test::mainc();
34 // t16thread::racecondition::mainr(); 34 t16thread::racecondition::mainr();
35 t16thread::racecondition::mainu(); 35 t16thread::racecondition::mainu();
36 } 36 }