Skip to content

Commit c39ab10

Browse files
committed
test: make the other_thread example noop on other platforms
1 parent 897795e commit c39ab10

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/other_thread.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Windows only currently
21
use backtrace::{Backtrace, BacktraceFrame};
2+
#[cfg(all(windows, not(target_vendor = "uwp")))]
33
use std::os::windows::prelude::AsRawHandle;
44

55
fn worker() {
@@ -14,12 +14,13 @@ fn bar() {
1414
fn baz() {
1515
println!("Hello from thread!");
1616
// Sleep for simple sync. Can't read thread that has finished running
17-
//std::thread::sleep(std::time::Duration::from_millis(1000));
17+
std::thread::sleep(std::time::Duration::from_millis(1000));
1818
loop {
1919
print!("");
2020
}
2121
}
2222

23+
#[cfg(all(windows, not(target_vendor = "uwp")))]
2324
fn main() {
2425
let thread = std::thread::spawn(|| {
2526
worker();
@@ -41,3 +42,6 @@ fn main() {
4142
bt.resolve();
4243
println!("{:?}", bt);
4344
}
45+
46+
#[cfg(not(all(windows, not(target_vendor = "uwp"))))]
47+
fn main() {}

0 commit comments

Comments
 (0)