diff options
| author | bors <bors@rust-lang.org> | 2013-10-07 21:46:39 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-10-07 21:46:39 -0700 |
| commit | 6ddd011ce8875c6c5b119e5a8957a51d524a95da (patch) | |
| tree | e9c5f3265e5d614bf9682dd09410978be2d0e39d /src/libstd/task | |
| parent | 132099950fc1d157b9af0130cf3f1eb20a263541 (diff) | |
| parent | 7cd66924252a46c1b4524b9de4ad5e4cfc1c1faa (diff) | |
| download | rust-6ddd011ce8875c6c5b119e5a8957a51d524a95da.tar.gz rust-6ddd011ce8875c6c5b119e5a8957a51d524a95da.zip | |
auto merge of #9735 : alexcrichton/rust/privacy, r=cmr
This is the culmination and attempted resolution of #8215. The commits have many more details about implementation details and the consequences of this refinement. I'll point out specific locations which may be possible causes for alarm. In general, I have been very happy with how things have turned out. I'm a little sad that I couldn't remove privacy from resolve as much as I did, but I blame glob imports (although in theory even some of this can be mitigated as well).
Diffstat (limited to 'src/libstd/task')
| -rw-r--r-- | src/libstd/task/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/task/spawn.rs | 11 |
2 files changed, 5 insertions, 10 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index 8e5353341ea..a46e115a503 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -551,7 +551,7 @@ pub fn deschedule() { //! Yield control to the task scheduler use rt::local::Local; - use rt::sched::Scheduler; + use rt::shouldnt_be_public::Scheduler; // FIXME(#7544): Optimize this, since we know we won't block. let sched: ~Scheduler = Local::take(); @@ -1069,7 +1069,7 @@ fn test_try_fail() { #[cfg(test)] fn get_sched_id() -> int { - do Local::borrow |sched: &mut ::rt::sched::Scheduler| { + do Local::borrow |sched: &mut ::rt::shouldnt_be_public::Scheduler| { sched.sched_id() as int } } diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index a77c9744298..a801bf3328d 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -89,11 +89,8 @@ use unstable::sync::Exclusive; use rt::in_green_task_context; use rt::local::Local; use rt::task::{Task, Sched}; -use rt::kill::KillHandle; -use rt::sched::Scheduler; +use rt::shouldnt_be_public::{Scheduler, KillHandle, WorkQueue, Thread}; use rt::uv::uvio::UvEventLoop; -use rt::thread::Thread; -use rt::work_queue::WorkQueue; #[cfg(test)] use task::default_task_opts; #[cfg(test)] use comm; @@ -556,8 +553,6 @@ fn enlist_many(child: &KillHandle, child_arc: &TaskGroupArc, } pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) { - use rt::sched::*; - rtassert!(in_green_task_context()); let child_data = Cell::new(gen_child_taskgroup(opts.linked, opts.supervised)); @@ -622,7 +617,7 @@ pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) { let mut new_sched_handle = new_sched.make_handle(); // Allow the scheduler to exit when the pinned task exits - new_sched_handle.send(Shutdown); + new_sched_handle.send_shutdown(); // Pin the new task to the new scheduler let new_task = if opts.watched { @@ -660,7 +655,7 @@ pub fn spawn_raw(mut opts: TaskOpts, f: ~fn()) { rtdebug!("enqueing join_task"); // Now tell the original scheduler to join with this thread // by scheduling a thread-joining task on the original scheduler - orig_sched_handle.send(TaskFromFriend(join_task)); + orig_sched_handle.send_task_from_friend(join_task); // NB: We can't simply send a message from here to another task // because this code isn't running in a task and message passing doesn't |
