about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorBen Blum <bblum@andrew.cmu.edu>2013-08-08 22:26:23 -0400
committerBen Blum <bblum@andrew.cmu.edu>2013-08-12 13:54:21 -0400
commitce48e71d28a69151a9f1fb7a620dcbad2834cef3 (patch)
tree9cba77e27a673dbadf959a8e159fd924cb148374 /src/libstd/rt
parent31f9b5159297ffbc6da8f6e640cd6f4f8ed7c44d (diff)
downloadrust-ce48e71d28a69151a9f1fb7a620dcbad2834cef3.tar.gz
rust-ce48e71d28a69151a9f1fb7a620dcbad2834cef3.zip
Fix select() in light of the deschedule...and then race. Close #8347.
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/comm.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstd/rt/comm.rs b/src/libstd/rt/comm.rs
index f43d1c74eae..42d59ccdf95 100644
--- a/src/libstd/rt/comm.rs
+++ b/src/libstd/rt/comm.rs
@@ -114,7 +114,9 @@ impl<T> ChanOne<T> {
     // 'do_resched' configures whether the scheduler immediately switches to
     // the receiving task, or leaves the sending task still running.
     fn try_send_inner(self, val: T, do_resched: bool) -> bool {
-        rtassert!(!rt::in_sched_context());
+        if do_resched {
+            rtassert!(!rt::in_sched_context());
+        }
 
         let mut this = self;
         let mut recvr_active = true;