diff options
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/comm.rs | 4 |
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; |
