Skip to content

Commit

Permalink
Mark unpark() as #[inline].
Browse files Browse the repository at this point in the history
  • Loading branch information
m-ou-se committed Sep 19, 2020
1 parent efa2546 commit 4bb0ddf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/thread/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,7 @@ impl Thread {
/// parked_thread.join().unwrap();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn unpark(&self) {
self.inner.parker.unpark();
}
Expand Down
1 change: 1 addition & 0 deletions library/std/src/thread/parker/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ impl Parker {
}
}

#[inline]
pub fn unpark(&self) {
// Change PARKED→NOTIFIED, EMPTY→NOTIFIED, or NOTIFIED→NOTIFIED, and
// wake the thread in the first case.
Expand Down

0 comments on commit 4bb0ddf

Please sign in to comment.