Mark unpark() as #[inline].

This commit is contained in:
Mara Bos 2020-09-19 14:54:52 +02:00
parent ec13df4ec4
commit f18f93d44c
2 changed files with 2 additions and 0 deletions

View File

@ -1086,6 +1086,7 @@ impl Thread {
/// parked_thread.join().unwrap();
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[inline]
pub fn unpark(&self) {
self.inner.parker.unpark();
}

View File

@ -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.