File tree Expand file tree Collapse file tree 4 files changed +352
-353
lines changed Expand file tree Collapse file tree 4 files changed +352
-353
lines changed Original file line number Diff line number Diff line change @@ -11,8 +11,10 @@ thread-priority = "0.9.2"
1111thread-amount = " 0.1.3"
1212crossbeam = " 0.8.2"
1313thread-control = " 0.1.2"
14- affinity = " 0.1.2"
1514rayon = " 1.5.3"
1615go-spawn = " 0.1.2"
1716num_threads = " 0.1.6"
1817parking = " 2.0.0"
18+
19+ [target .'cfg(any(windows, linux))' .dependencies ]
20+ affinity = " 0.1.2"
Original file line number Diff line number Diff line change 1- pub mod threads;
2-
3- pub use threads:: * ;
4-
5-
6- pub fn panic_example ( ) {
7- println ! ( "Hello, world!" ) ;
8-
9- let h = std:: thread:: spawn ( || {
10- std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 1000 ) ) ;
11- panic ! ( "boom" ) ;
12- } ) ;
13-
14- let r = h. join ( ) ;
15- match r {
16- Ok ( r) => println ! ( "All is well! {:?}" , r) ,
17- Err ( e) => println ! ( "Got an error! {:?}" , e)
18- }
19-
20- println ! ( "Exiting main!" )
21- }
1+ pub mod threads;
2+
3+ pub use threads:: * ;
4+
5+ pub fn panic_example ( ) {
6+ println ! ( "Hello, world!" ) ;
7+
8+ let h = std:: thread:: spawn ( || {
9+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 1000 ) ) ;
10+ panic ! ( "boom" ) ;
11+ } ) ;
12+
13+ let r = h. join ( ) ;
14+ match r {
15+ Ok ( r) => println ! ( "All is well! {:?}" , r) ,
16+ Err ( e) => println ! ( "Got an error! {:?}" , e) ,
17+ }
18+
19+ println ! ( "Exiting main!" )
20+ }
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ fn main() {
2323
2424 control_thread ( ) ;
2525
26+ #[ cfg( not( target_os = "macos" ) ) ]
2627 use_affinity ( ) ;
2728
2829 go_thread ( ) ;
@@ -31,4 +32,3 @@ fn main() {
3132
3233 panic_example ( ) ;
3334}
34-
You can’t perform that action at this time.
0 commit comments