summaryrefslogtreecommitdiffstats
path: root/third_party/rust/audio_thread_priority/README.md
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 14:29:10 +0000
commit2aa4a82499d4becd2284cdb482213d541b8804dd (patch)
treeb80bf8bf13c3766139fbacc530efd0dd9d54394c /third_party/rust/audio_thread_priority/README.md
parentInitial commit. (diff)
downloadfirefox-upstream.tar.xz
firefox-upstream.zip
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/audio_thread_priority/README.md')
-rw-r--r--third_party/rust/audio_thread_priority/README.md37
1 files changed, 37 insertions, 0 deletions
diff --git a/third_party/rust/audio_thread_priority/README.md b/third_party/rust/audio_thread_priority/README.md
new file mode 100644
index 0000000000..66c2522991
--- /dev/null
+++ b/third_party/rust/audio_thread_priority/README.md
@@ -0,0 +1,37 @@
+# audio_thread_priority
+
+Synopsis:
+
+```rust
+ // ... 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
+