auto merge of #8139 : brson/rust/rm-old-task-apis, r=pcwalton

This removes a bunch of options from the task builder interface that are irrelevant to the new scheduler and were generally unused anyway. It also bumps the stack size of new scheduler tasks so that there's enough room to run rustc and changes the interface to `Thread` to not implicitly join threads on destruction, but instead require an explicit, and mandatory, call to `join`.
This commit is contained in:
bors 2013-07-31 02:10:24 -07:00
commit 8b7e241e02
20 changed files with 89 additions and 244 deletions

View file

@ -12,7 +12,6 @@
use comm::{GenericChan, GenericPort};
use comm;
use libc;
use prelude::*;
use task;
@ -37,18 +36,16 @@ The executing thread has no access to a task pointer and will be using
a normal large stack.
*/
pub fn run_in_bare_thread(f: ~fn()) {
use cell::Cell;
use rt::thread::Thread;
let f_cell = Cell::new(f);
let (port, chan) = comm::stream();
// FIXME #4525: Unfortunate that this creates an extra scheduler but it's
// necessary since rust_raw_thread_join_delete is blocking
// necessary since rust_raw_thread_join is blocking
do task::spawn_sched(task::SingleThreaded) {
unsafe {
let closure: &fn() = || {
f()
};
let thread = rust_raw_thread_start(&closure);
rust_raw_thread_join_delete(thread);
chan.send(());
}
Thread::start(f_cell.take()).join();
chan.send(());
}
port.recv();
}
@ -70,14 +67,6 @@ fn test_run_in_bare_thread_exchange() {
}
}
#[allow(non_camel_case_types)] // runtime type
pub type raw_thread = libc::c_void;
extern {
fn rust_raw_thread_start(f: &(&fn())) -> *raw_thread;
fn rust_raw_thread_join_delete(thread: *raw_thread);
}
/// Changes the current working directory to the specified
/// path while acquiring a global lock, then calls `action`.