Skip to content

Commit

Permalink
Apply #[must_use] to RawPriorityInheritingLock::new() and gettid()
Browse files Browse the repository at this point in the history
  • Loading branch information
rtzoeller committed Nov 26, 2023
1 parent 174971c commit 11a1a54
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [Unreleased] - ReleaseDate

- Updated MSRV to 1.65.0.
- Mark `RawPriorityInheritingLock::new()` and `gettid()` as `#[must_use]`.

## [0.2.3] - 2023-06-09

- Updated `linux-futex` dependency to 0.2.0.
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ pub struct RawPriorityInheritingLock<S>(linux_futex::PiFutex<S>);

impl<S> RawPriorityInheritingLock<S> {
/// Create a new, unlocked `RawPriorityInheritingLock`.
#[must_use]
pub const fn new() -> Self {
Self(linux_futex::PiFutex::new(0))
}
Expand Down Expand Up @@ -144,6 +145,7 @@ pub type SharedPriorityInheritingLockGuard<'a, T> =
/// Safe wrapper around `gettid`.
///
/// `gettid` is always successful on Linux.
#[must_use]
pub fn gettid() -> libc::pid_t {
unsafe { libc::gettid() }
}
Expand Down

0 comments on commit 11a1a54

Please sign in to comment.