Skip to content

Commit 061b56b

Browse files
author
Felix Raimundo
committed
Add a link to park in the park_timeout doc.
Part of #29378
1 parent a6ab049 commit 061b56b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/libstd/thread/mod.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -585,16 +585,17 @@ pub fn park() {
585585
/// Blocks unless or until the current thread's token is made available or
586586
/// the specified duration has been reached (may wake spuriously).
587587
///
588-
/// The semantics of this function are equivalent to `park()` except that the
589-
/// thread will be blocked for roughly no longer than `ms`. This method
590-
/// should not be used for precise timing due to anomalies such as
588+
/// The semantics of this function are equivalent to [`park()`][[park] except
589+
/// that the thread will be blocked for roughly no longer than `dur`. This
590+
/// method should not be used for precise timing due to anomalies such as
591591
/// preemption or platform differences that may not cause the maximum
592592
/// amount of time waited to be precisely `ms` long.
593593
///
594594
/// See the [module documentation][thread] for more detail.
595595
///
596596
/// [thread]: index.html
597597
/// [park_timeout]: fn.park_timeout.html
598+
/// [park]: fn.park.html
598599
#[stable(feature = "rust1", since = "1.0.0")]
599600
#[rustc_deprecated(since = "1.6.0", reason = "replaced by `std::thread::park_timeout`")]
600601
pub fn park_timeout_ms(ms: u32) {
@@ -604,9 +605,9 @@ pub fn park_timeout_ms(ms: u32) {
604605
/// Blocks unless or until the current thread's token is made available or
605606
/// the specified duration has been reached (may wake spuriously).
606607
///
607-
/// The semantics of this function are equivalent to `park()` except that the
608-
/// thread will be blocked for roughly no longer than `dur`. This method
609-
/// should not be used for precise timing due to anomalies such as
608+
/// The semantics of this function are equivalent to [`park()`][[park] except
609+
/// that the thread will be blocked for roughly no longer than `dur`. This
610+
/// method should not be used for precise timing due to anomalies such as
610611
/// preemption or platform differences that may not cause the maximum
611612
/// amount of time waited to be precisely `dur` long.
612613
///
@@ -635,6 +636,8 @@ pub fn park_timeout_ms(ms: u32) {
635636
/// park_timeout(timeout);
636637
/// }
637638
/// ```
639+
///
640+
/// [park]: fn.park.html
638641
#[stable(feature = "park_timeout", since = "1.4.0")]
639642
pub fn park_timeout(dur: Duration) {
640643
let thread = current();

0 commit comments

Comments
 (0)