gecko-dev/third_party/rust/audio_thread_priority
Paul Adenot 2196bcaba6 Bug 1575883 - mach vendor rust. r=kinetik
Differential Revision: https://phabricator.services.mozilla.com/D47282

--HG--
rename : third_party/rust/scoped-tls-0.1.0/LICENSE-APACHE => third_party/rust/semver-0.7.0/LICENSE-APACHE
rename : third_party/rust/scoped-tls-0.1.0/LICENSE-MIT => third_party/rust/semver-0.7.0/LICENSE-MIT
extra : moz-landing-system : lando
2019-10-11 16:02:18 +00:00
..
src Bug 1575883 - mach vendor rust. r=kinetik 2019-10-11 16:02:18 +00:00
.cargo-checksum.json Bug 1575883 - mach vendor rust. r=kinetik 2019-10-11 16:02:18 +00:00
Cargo.toml Bug 1575883 - mach vendor rust. r=kinetik 2019-10-11 16:02:18 +00:00
Makefile Bug 1575883 - mach vendor rust. r=kinetik 2019-10-11 16:02:18 +00:00
README.md
atp_test.cpp Bug 1575883 - mach vendor rust. r=kinetik 2019-10-11 16:02:18 +00:00
audio_thread_priority.h Bug 1575883 - mach vendor rust. r=kinetik 2019-10-11 16:02:18 +00:00
generate_osx_bindings.sh

README.md

audio_thread_priority

Synopsis:

  // ... on a thread that will compute audio and has to be real-time:
  RtPriorityHandle handle;

  match promote_current_thread_to_real_time(512, 44100) {
    Ok(h) => {
      handle = h;
      println!("this thread is now bumped to real-time priority.") 
    }
    Err(...) => { println!("could not bump to real time.") }
  }

  // do some real-time work.

  match demote_current_thread_from_real_time(h) {
    Ok(...) => {
      println!("this thread is now bumped back to normal.")
    }
    Err(...) => {
      println!("Could not bring the thread back to normal priority.")
    }
  }

This library can also be used from C or C++ using the included header and compiling the rust code in the application. By default, a .a is compiled to ease linking.

License

MPL-2