File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 1
- // Windows only currently
2
1
use backtrace:: { Backtrace , BacktraceFrame } ;
2
+ #[ cfg( all( windows, not( target_vendor = "uwp" ) ) ) ]
3
3
use std:: os:: windows:: prelude:: AsRawHandle ;
4
4
5
+ #[ cfg( all( windows, not( target_vendor = "uwp" ) ) ) ]
5
6
fn worker ( ) {
6
7
foo ( ) ;
7
8
}
9
+
10
+ #[ cfg( all( windows, not( target_vendor = "uwp" ) ) ) ]
8
11
fn foo ( ) {
9
12
bar ( )
10
13
}
14
+
15
+ #[ cfg( all( windows, not( target_vendor = "uwp" ) ) ) ]
11
16
fn bar ( ) {
12
17
baz ( )
13
18
}
19
+
20
+ #[ cfg( all( windows, not( target_vendor = "uwp" ) ) ) ]
14
21
fn baz ( ) {
15
22
println ! ( "Hello from thread!" ) ;
16
23
// Sleep for simple sync. Can't read thread that has finished running
17
- // std::thread::sleep(std::time::Duration::from_millis(1000));
24
+ std:: thread:: sleep ( std:: time:: Duration :: from_millis ( 1000 ) ) ;
18
25
loop {
19
26
print ! ( "" ) ;
20
27
}
21
28
}
22
29
30
+ #[ cfg( all( windows, not( target_vendor = "uwp" ) ) ) ]
23
31
fn main ( ) {
24
32
let thread = std:: thread:: spawn ( || {
25
33
worker ( ) ;
@@ -41,3 +49,8 @@ fn main() {
41
49
bt. resolve ( ) ;
42
50
println ! ( "{:?}" , bt) ;
43
51
}
52
+
53
+ #[ cfg( not( all( windows, not( target_vendor = "uwp" ) ) ) ) ]
54
+ fn main ( ) {
55
+ println ! ( "This example is skipped on non Windows platforms" ) ;
56
+ }
You can’t perform that action at this time.
0 commit comments