From f18f93d44cb2d95388865f98bb5938e572f0fc94 Mon Sep 17 00:00:00 2001 From: Mara Bos Date: Sat, 19 Sep 2020 14:54:52 +0200 Subject: [PATCH] Mark unpark() as #[inline]. --- library/std/src/thread/mod.rs | 1 + library/std/src/thread/parker/linux.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/library/std/src/thread/mod.rs b/library/std/src/thread/mod.rs index a5a8d5c9fbb..45430e58cbb 100644 --- a/library/std/src/thread/mod.rs +++ b/library/std/src/thread/mod.rs @@ -1086,6 +1086,7 @@ pub(crate) fn new(name: Option) -> Thread { /// parked_thread.join().unwrap(); /// ``` #[stable(feature = "rust1", since = "1.0.0")] + #[inline] pub fn unpark(&self) { self.inner.parker.unpark(); } diff --git a/library/std/src/thread/parker/linux.rs b/library/std/src/thread/parker/linux.rs index 05142b88c73..2e238dcdc0b 100644 --- a/library/std/src/thread/parker/linux.rs +++ b/library/std/src/thread/parker/linux.rs @@ -57,6 +57,7 @@ pub unsafe fn park_timeout(&self, timeout: Duration) { } } + #[inline] pub fn unpark(&self) { // Change PARKED=>NOTIFIED, EMPTY=>NOTIFIED, or NOTIFIED=>NOTIFIED, and // wake the thread in the first case. -- 2.44.0