From 3bf989f4c945e91c2ff99ac66ef0f6405e975ff4 Mon Sep 17 00:00:00 2001 From: Stefan Schindler Date: Fri, 16 Feb 2018 10:30:31 +0100 Subject: [PATCH 1/2] Add link to yield_now --- src/libcore/sync/atomic.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index f22862ae70190..63fb6e437e4cc 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -97,9 +97,10 @@ use fmt; /// Save power or switch hyperthreads in a busy-wait spin-loop. /// /// This function is deliberately more primitive than -/// `std::thread::yield_now` and does not directly yield to the -/// system's scheduler. In some cases it might be useful to use a -/// combination of both functions. Careful benchmarking is advised. +/// [`std::thread::yield_now`](../../thread/fn.yield_now.html) and +/// does not directly yield to the system's scheduler. +/// In some cases it might be useful to use a combination of both functions. +/// Careful benchmarking is advised. /// /// On some platforms this function may not do anything at all. #[inline] From e812da0ed050e2bfa7e12b6f35f077c6c3f19a1b Mon Sep 17 00:00:00 2001 From: Stefan Schindler Date: Fri, 16 Feb 2018 12:20:54 +0100 Subject: [PATCH 2/2] Force the link to std::thread::yield_now() --- src/libcore/sync/atomic.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index 63fb6e437e4cc..25827edee7d93 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -97,7 +97,7 @@ use fmt; /// Save power or switch hyperthreads in a busy-wait spin-loop. /// /// This function is deliberately more primitive than -/// [`std::thread::yield_now`](../../thread/fn.yield_now.html) and +/// [`std::thread::yield_now`](../../../std/thread/fn.yield_now.html) and /// does not directly yield to the system's scheduler. /// In some cases it might be useful to use a combination of both functions. /// Careful benchmarking is advised.