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