about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-12-28 11:25:28 -0800
committerAlex Crichton <alex@alexcrichton.com>2013-12-28 11:25:28 -0800
commit0aab974a6c3cf98d17d81ec9b83ad57423dcfb9f (patch)
treee51b5963d5e84213d1436c1a785507d195cb2169 /src/libstd
parent1b2cebc2c1f4d6e4bad36f4fa682f3d4e70cfb70 (diff)
downloadrust-0aab974a6c3cf98d17d81ec9b83ad57423dcfb9f.tar.gz
rust-0aab974a6c3cf98d17d81ec9b83ad57423dcfb9f.zip
Guard a maybe_yield in Chan with can_resched
I forgot to add this back in after I removed can_resched and then realized I had
to add it back.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/comm/mod.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstd/comm/mod.rs b/src/libstd/comm/mod.rs
index 21db234122b..26e235e6d52 100644
--- a/src/libstd/comm/mod.rs
+++ b/src/libstd/comm/mod.rs
@@ -599,7 +599,7 @@ impl<T: Send> Chan<T> {
                 // the TLS overhead can be a bit much.
                 n => {
                     assert!(n >= 0);
-                    if n > 0 && n % RESCHED_FREQ == 0 {
+                    if can_resched && n > 0 && n % RESCHED_FREQ == 0 {
                         let task: ~Task = Local::take();
                         task.maybe_yield();
                     }