diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-10-05 14:44:37 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-10-07 13:00:52 -0700 |
| commit | de7d1431760c788e5a471194fa85675033d0ed72 (patch) | |
| tree | 2ece65f6d02061b9ed83dc19a20dc2a5401374d0 /src/libstd/task/spawn.rs | |
| parent | 439e2770be6aec41a3961235305787a78d47fbdd (diff) | |
| download | rust-de7d1431760c788e5a471194fa85675033d0ed72.tar.gz rust-de7d1431760c788e5a471194fa85675033d0ed72.zip | |
Fix existing privacy/visibility violations
This commit fixes all of the fallout of the previous commit which is an attempt to refine privacy. There were a few unfortunate leaks which now must be plugged, and the most horrible one is the current `shouldnt_be_public` module now inside `std::rt`. I think that this either needs a slight reorganization of the runtime, or otherwise it needs to just wait for the external users of these modules to get replaced with their `rt` implementations. Other fixes involve making things pub which should be pub, and otherwise updating error messages that now reference privacy instead of referencing an "unresolved name" (yay!).
Diffstat (limited to 'src/libstd/task/spawn.rs')
| -rw-r--r-- | src/libstd/task/spawn.rs | 11 |
1 files changed, 3 insertions, 8 deletions
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 |
