Browse Source

Use the new ThreadBuilderExt trait

pull/46/head
AzureMarker 3 years ago
parent
commit
15763bac1d
No known key found for this signature in database
GPG Key ID: 47A133F3BF9D03D3
  1. 3
      ctru-rs/examples/futures-basic.rs
  2. 3
      ctru-rs/examples/futures-tokio.rs
  3. 4
      ctru-rs/examples/thread-basic.rs
  4. 3
      ctru-rs/examples/thread-locals.rs

3
ctru-rs/examples/futures-basic.rs

@ -5,11 +5,14 @@ @@ -5,11 +5,14 @@
//! The example also implements clean shutdown by using a oneshot channel to end the future, thus
//! ending the executor and the thread it runs on.
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use futures::StreamExt;
use std::os::horizon::thread::ThreadBuilderExt;
fn main() {
ctru::init();

3
ctru-rs/examples/futures-tokio.rs

@ -1,8 +1,11 @@ @@ -1,8 +1,11 @@
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::ps::Ps;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use std::os::horizon::thread::ThreadBuilderExt;
use std::time::Duration;
fn main() {

4
ctru-rs/examples/thread-basic.rs

@ -1,8 +1,10 @@ @@ -1,8 +1,10 @@
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::gfx::Gfx;
use ctru::services::apt::Apt;
use ctru::services::hid::{Hid, KeyPad};
use std::os::horizon::thread::ThreadBuilderExt;
use std::time::Duration;
fn main() {

3
ctru-rs/examples/thread-locals.rs

@ -1,8 +1,11 @@ @@ -1,8 +1,11 @@
#![feature(horizon_thread_ext)]
use ctru::console::Console;
use ctru::services::hid::KeyPad;
use ctru::services::{Apt, Hid};
use ctru::Gfx;
use std::cell::RefCell;
use std::os::horizon::thread::ThreadBuilderExt;
std::thread_local! {
static MY_LOCAL: RefCell<&'static str> = RefCell::new("initial value");

Loading…
Cancel
Save