Browse Source

IT WORKS

Needs some fixes in pthread-3ds.
Made the log less noisy and added some comments.
pull/42/head
AzureMarker 3 years ago
parent
commit
fd9b58498d
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 4
      ctru-rs/examples/futures-tokio-basic.rs

4
ctru-rs/examples/futures-tokio-basic.rs

@ -26,15 +26,15 @@ fn main() {
.expect("Couldn't build runtime"); .expect("Couldn't build runtime");
let runtime_thread = ctru::thread::Builder::new() let runtime_thread = ctru::thread::Builder::new()
// Run on the system core
.affinity(1) .affinity(1)
// Use a bigger stack size. Default is 0x1000 but we'd easily overflow that.
.stack_size(0x200000) .stack_size(0x200000)
.spawn(move || { .spawn(move || {
runtime.block_on(async move { runtime.block_on(async move {
println!("Start of future");
let mut wake_time = tokio::time::Instant::now() + Duration::from_secs(1); let mut wake_time = tokio::time::Instant::now() + Duration::from_secs(1);
let mut iteration = 0; let mut iteration = 0;
loop { loop {
println!("Start of loop");
let sleep_future = tokio::time::sleep_until(wake_time); let sleep_future = tokio::time::sleep_until(wake_time);
tokio::select! { tokio::select! {

Loading…
Cancel
Save