From ce48e71d28a69151a9f1fb7a620dcbad2834cef3 Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Thu, 8 Aug 2013 22:26:23 -0400 Subject: Fix select() in light of the deschedule...and then race. Close #8347. --- src/libstd/rt/comm.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libstd/rt') 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 ChanOne { // '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; -- cgit 1.4.1-3-g733a5