Skip to content

Commit 63cfc99

Browse files
committed
auto merge of #10406 : alexcrichton/rust/issue-10405, r=huonw
The logging macros all use libuv-based I/O, and there was one stray debug statement in task::spawn which was executing before the I/O context was ready. Remove it and add a test to make sure that we can continue to debug this sort of code. Closes #10405
2 parents 95b46a1 + b71d629 commit 63cfc99

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/libstd/task/spawn.rs

-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,6 @@ pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) {
661661
};
662662
new_sched.bootstrap(bootstrap_task);
663663

664-
debug!("enqueing join_task");
665664
// Now tell the original scheduler to join with this thread
666665
// by scheduling a thread-joining task on the original scheduler
667666
orig_sched_handle.send(TaskFromFriend(join_task));
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// exec-env:RUST_LOG=debug
12+
// xfail-fast
13+
14+
// regression test for issue #10405, make sure we don't call debug! too soon.
15+
16+
use std::task;
17+
18+
fn main() {
19+
let mut t = task::task();
20+
t.sched_mode(task::SingleThreaded);
21+
t.spawn(|| ());
22+
}

0 commit comments

Comments
 (0)