diff options
| author | bors <bors@rust-lang.org> | 2013-08-07 16:47:15 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-07 16:47:15 -0700 |
| commit | 9db698a81b0d68b093030fe52f941146aba65dd3 (patch) | |
| tree | 3e28ddda85efcf6b8e6468b4fe54b46f33b2b4d5 /src/libstd/task | |
| parent | a85f9acbfce3d47cf05ce4dd33a06907df261d49 (diff) | |
| parent | 85aaa44bec2a87f8df290d4f9b3f7350de50d067 (diff) | |
| download | rust-9db698a81b0d68b093030fe52f941146aba65dd3.tar.gz rust-9db698a81b0d68b093030fe52f941146aba65dd3.zip | |
auto merge of #8358 : brson/rust/newrt, r=brson
Diffstat (limited to 'src/libstd/task')
| -rw-r--r-- | src/libstd/task/mod.rs | 31 | ||||
| -rw-r--r-- | src/libstd/task/spawn.rs | 14 |
2 files changed, 34 insertions, 11 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index 225a4b8cfd2..2e0c9c1d1ad 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -142,7 +142,8 @@ pub struct TaskOpts { indestructible: bool, notify_chan: Option<Chan<TaskResult>>, name: Option<~str>, - sched: SchedOpts + sched: SchedOpts, + stack_size: Option<uint> } /** @@ -197,7 +198,8 @@ impl TaskBuilder { indestructible: self.opts.indestructible, notify_chan: notify_chan, name: name, - sched: self.opts.sched + sched: self.opts.sched, + stack_size: self.opts.stack_size }, gen_body: gen_body, can_not_copy: None, @@ -351,7 +353,8 @@ impl TaskBuilder { indestructible: x.opts.indestructible, notify_chan: notify_chan, name: name, - sched: x.opts.sched + sched: x.opts.sched, + stack_size: x.opts.stack_size }; let f = match gen_body { Some(gen) => { @@ -422,7 +425,8 @@ pub fn default_task_opts() -> TaskOpts { name: None, sched: SchedOpts { mode: DefaultScheduler, - } + }, + stack_size: None } } @@ -655,6 +659,7 @@ pub unsafe fn rekillable<U>(f: &fn() -> U) -> U { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_kill_unkillable_task() { use rt::test::*; @@ -675,6 +680,7 @@ fn test_kill_unkillable_task() { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_kill_rekillable_task() { use rt::test::*; @@ -716,6 +722,7 @@ fn test_cant_dup_task_builder() { #[cfg(test)] fn block_forever() { let (po, _ch) = stream::<()>(); po.recv(); } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port use rt::test::run_in_newsched_task; @@ -734,6 +741,7 @@ fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port po.recv(); } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_unlinked_unsup_no_fail_up() { // child unlinked fails use rt::test::run_in_newsched_task; @@ -741,6 +749,7 @@ fn test_spawn_unlinked_unsup_no_fail_up() { // child unlinked fails do spawn_unlinked { fail!(); } } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails use rt::test::run_in_newsched_task; @@ -750,6 +759,7 @@ fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails do 16.times { task::yield(); } } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_unlinked_sup_fail_down() { use rt::test::run_in_newsched_task; @@ -762,6 +772,7 @@ fn test_spawn_unlinked_sup_fail_down() { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_linked_sup_fail_up() { // child fails; parent fails use rt::test::run_in_newsched_task; @@ -782,6 +793,7 @@ fn test_spawn_linked_sup_fail_up() { // child fails; parent fails assert!(result.is_err()); } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_linked_sup_fail_down() { // parent fails; child fails use rt::test::run_in_newsched_task; @@ -798,6 +810,7 @@ fn test_spawn_linked_sup_fail_down() { // parent fails; child fails assert!(result.is_err()); } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_linked_unsup_fail_up() { // child fails; parent fails use rt::test::run_in_newsched_task; @@ -810,6 +823,7 @@ fn test_spawn_linked_unsup_fail_up() { // child fails; parent fails assert!(result.is_err()); } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_linked_unsup_fail_down() { // parent fails; child fails use rt::test::run_in_newsched_task; @@ -822,6 +836,7 @@ fn test_spawn_linked_unsup_fail_down() { // parent fails; child fails assert!(result.is_err()); } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_linked_unsup_default_opts() { // parent fails; child fails use rt::test::run_in_newsched_task; @@ -840,6 +855,7 @@ fn test_spawn_linked_unsup_default_opts() { // parent fails; child fails // A couple bonus linked failure tests - testing for failure propagation even // when the middle task exits successfully early before kill signals are sent. +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_failure_propagate_grandchild() { use rt::test::run_in_newsched_task; @@ -856,6 +872,7 @@ fn test_spawn_failure_propagate_grandchild() { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_failure_propagate_secondborn() { use rt::test::run_in_newsched_task; @@ -872,6 +889,7 @@ fn test_spawn_failure_propagate_secondborn() { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_failure_propagate_nephew_or_niece() { use rt::test::run_in_newsched_task; @@ -888,6 +906,7 @@ fn test_spawn_failure_propagate_nephew_or_niece() { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_linked_sup_propagate_sibling() { use rt::test::run_in_newsched_task; @@ -1191,6 +1210,7 @@ fn test_avoid_copying_the_body_unlinked() { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] #[should_fail] @@ -1226,6 +1246,7 @@ fn test_unkillable() { po.recv(); } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] #[should_fail] @@ -1292,6 +1313,7 @@ fn test_simple_newsched_spawn() { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_spawn_watched() { use rt::test::run_in_newsched_task; @@ -1314,6 +1336,7 @@ fn test_spawn_watched() { } } +#[ignore(reason = "linked failure")] #[test] #[ignore(cfg(windows))] fn test_indestructible() { use rt::test::run_in_newsched_task; diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 7486a78837c..2d0a2d98e9f 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -713,9 +713,9 @@ fn spawn_raw_newsched(mut opts: TaskOpts, f: ~fn()) { let mut task = unsafe { if opts.sched.mode != SingleThreaded { if opts.watched { - Task::build_child(child_wrapper) + Task::build_child(opts.stack_size, child_wrapper) } else { - Task::build_root(child_wrapper) + Task::build_root(opts.stack_size, child_wrapper) } } else { // Creating a 1:1 task:thread ... @@ -736,16 +736,16 @@ fn spawn_raw_newsched(mut opts: TaskOpts, f: ~fn()) { // Pin the new task to the new scheduler let new_task = if opts.watched { - Task::build_homed_child(child_wrapper, Sched(new_sched_handle)) + Task::build_homed_child(opts.stack_size, child_wrapper, Sched(new_sched_handle)) } else { - Task::build_homed_root(child_wrapper, Sched(new_sched_handle)) + Task::build_homed_root(opts.stack_size, child_wrapper, Sched(new_sched_handle)) }; // Create a task that will later be used to join with the new scheduler // thread when it is ready to terminate let (thread_port, thread_chan) = oneshot(); let thread_port_cell = Cell::new(thread_port); - let join_task = do Task::build_child() { + let join_task = do Task::build_child(None) { rtdebug!("running join task"); let thread_port = thread_port_cell.take(); let thread: Thread = thread_port.recv(); @@ -762,8 +762,8 @@ fn spawn_raw_newsched(mut opts: TaskOpts, f: ~fn()) { let mut orig_sched_handle = orig_sched_handle_cell.take(); let join_task = join_task_cell.take(); - let bootstrap_task = ~do Task::new_root(&mut new_sched.stack_pool) || { - rtdebug!("bootstrapping a 1:1 scheduler"); + let bootstrap_task = ~do Task::new_root(&mut new_sched.stack_pool, None) || { + rtdebug!("boostrapping a 1:1 scheduler"); }; new_sched.bootstrap(bootstrap_task); |
