Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ cfg_if! {
pub fn deserialize(_: [u8; 1]) -> Self {
RtPriorityThreadInfo{_dummy: 0}
}
/// Returns the PID of the process containing the thread (fallback: always -1).
pub fn pid(&self) -> i32 {
-1
}
}
/// Fallback implementation that performs no operation for unsupported platforms.
pub fn promote_current_thread_to_real_time_internal(_: u32, audio_samplerate_hz: u32) -> Result<RtPriorityHandle, AudioThreadPriorityError> {
Expand Down
4 changes: 4 additions & 0 deletions src/rt_linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ impl RtPriorityThreadInfoInternal {
pub fn deserialize(bytes: [u8; std::mem::size_of::<Self>()]) -> Self {
unsafe { std::mem::transmute::<[u8; std::mem::size_of::<Self>()], Self>(bytes) }
}
/// Returns the PID of the process containing the thread.
pub fn pid(&self) -> libc::pid_t {
self.pid
}
}

impl PartialEq for RtPriorityThreadInfoInternal {
Expand Down
Loading