Permalink
Browse files

Rename core::comm to core::oldcomm

  • Loading branch information...
1 parent 80ef724 commit e6d1b02359f4535c23af1059fcd48d18814fcb46 @brson brson committed Dec 13, 2012
Showing with 712 additions and 719 deletions.
  1. +1 −1 src/libcore/core.rc
  2. +3 −3 src/libcore/{comm.rs → oldcomm.rs}
  3. +20 −20 src/libcore/os.rs
  4. +33 −33 src/libcore/private.rs
  5. +5 −5 src/libcore/run.rs
  6. +59 −59 src/libcore/task/mod.rs
  7. +4 −4 src/libcore/task/spawn.rs
  8. +6 −6 src/librustc/rustc.rc
  9. +9 −9 src/librustdoc/astsrv.rs
  10. +14 −14 src/librustdoc/markdown_pass.rs
  11. +7 −7 src/librustdoc/markdown_writer.rs
  12. +9 −9 src/librustdoc/page_pass.rs
  13. +11 −11 src/librustdoc/util.rs
  14. +2 −3 src/libstd/net_ip.rs
  15. +110 −111 src/libstd/net_tcp.rs
  16. +18 −19 src/libstd/test.rs
  17. +23 −24 src/libstd/timer.rs
  18. +14 −15 src/libstd/uv_global_loop.rs
  19. +17 −18 src/libstd/uv_iotask.rs
  20. +18 −19 src/libstd/uv_ll.rs
  21. +1 −1 src/test/auxiliary/cci_capture_clause.rs
  22. +2 −2 src/test/auxiliary/test_comm.rs
  23. +1 −1 src/test/bench/graph500-bfs.rs
  24. +3 −3 src/test/bench/msgsend-ring.rs
  25. +24 −24 src/test/bench/shootout-chameneos-redux.rs
  26. +1 −1 src/test/bench/shootout-k-nucleotide-pipes.rs
  27. +10 −10 src/test/bench/shootout-mandelbrot.rs
  28. +1 −1 src/test/bench/shootout-pfib.rs
  29. +5 −5 src/test/bench/task-perf-linked-failure.rs
  30. +15 −15 src/test/bench/task-perf-one-million.rs
  31. +5 −5 src/test/bench/task-perf-word-count-generic.rs
  32. +1 −1 src/test/compile-fail/no-capture-arc.rs
  33. +1 −1 src/test/compile-fail/no-reuse-move-arc.rs
  34. +3 −3 src/test/compile-fail/no-send-res-ports.rs
  35. +3 −3 src/test/compile-fail/unsendable-class.rs
  36. +2 −2 src/test/run-fail/linked-failure.rs
  37. +3 −3 src/test/run-fail/linked-failure2.rs
  38. +2 −2 src/test/run-fail/linked-failure3.rs
  39. +3 −3 src/test/run-fail/linked-failure4.rs
  40. +4 −4 src/test/run-fail/port-type.rs
  41. +2 −2 src/test/run-fail/task-comm-recv-block.rs
  42. +4 −4 src/test/run-pass/acyclic-unwind.rs
  43. +1 −1 src/test/run-pass/auto_serialize.rs
  44. +7 −7 src/test/run-pass/basic-1.rs
  45. +8 −8 src/test/run-pass/basic-2.rs
  46. +8 −8 src/test/run-pass/basic.rs
  47. +3 −3 src/test/run-pass/capture_nil.rs
  48. +1 −1 src/test/run-pass/cci_capture_clause.rs
  49. +13 −13 src/test/run-pass/chan-leak.rs
  50. +5 −5 src/test/run-pass/comm.rs
  51. +6 −6 src/test/run-pass/decl-with-recv.rs
  52. +4 −4 src/test/run-pass/hashmap-memory.rs
  53. +5 −5 src/test/run-pass/issue-507.rs
  54. +15 −15 src/test/run-pass/issue-687.rs
  55. +6 −6 src/test/run-pass/issue-783.rs
  56. +5 −5 src/test/run-pass/ivec-tag.rs
  57. +5 −5 src/test/run-pass/lazychan.rs
  58. +9 −9 src/test/run-pass/many.rs
  59. +1 −1 src/test/run-pass/multiline-comment.rs
  60. +23 −23 src/test/run-pass/rt-circular-buffer.rs
  61. +4 −4 src/test/run-pass/rt-sched-1.rs
  62. +4 −4 src/test/run-pass/send-iloop.rs
  63. +4 −4 src/test/run-pass/send-resource.rs
  64. +3 −3 src/test/run-pass/send-type-inference.rs
  65. +3 −3 src/test/run-pass/sendable-class.rs
  66. +2 −2 src/test/run-pass/sendfn-generic-fn.rs
  67. +3 −3 src/test/run-pass/spawn-types.rs
  68. +3 −3 src/test/run-pass/task-comm-chan-cleanup.rs
  69. +3 −3 src/test/run-pass/task-comm-chan-cleanup2.rs
  70. +3 −3 src/test/run-pass/task-comm-chan-cleanup3.rs
  71. +4 −4 src/test/run-pass/task-comm-chan-cleanup4.rs
  72. +4 −4 src/test/run-pass/task-comm-chan-nil.rs
  73. +22 −22 src/test/run-pass/task-comm.rs
  74. +13 −13 src/test/run-pass/task-compare.rs
  75. +9 −9 src/test/run-pass/task-killjoin-rsrc.rs
  76. +6 −6 src/test/run-pass/task-spawn-move-and-copy.rs
  77. +5 −5 src/test/run-pass/unique-send-2.rs
  78. +4 −4 src/test/run-pass/unique-send.rs
  79. +7 −7 src/test/run-pass/unwind-resource.rs
  80. +2 −2 src/test/run-pass/variant-attributes.rs
View
@@ -139,7 +139,7 @@ pub mod send_map;
/* Tasks and communication */
-pub mod comm;
+pub mod oldcomm;
#[path = "task/mod.rs"]
pub mod task;
pub mod pipes;
@@ -144,7 +144,7 @@ fn PortPtr<T: Owned>(po: *rust_port) -> PortPtr<T> {
* Fails if the port is detached or dead. Fails if the port
* is owned by a different task.
*/
-fn as_raw_port<T: Owned, U>(ch: comm::Chan<T>, f: fn(*rust_port) -> U) -> U {
+fn as_raw_port<T: Owned, U>(ch: Chan<T>, f: fn(*rust_port) -> U) -> U {
struct PortRef {
p: *rust_port,
@@ -205,11 +205,11 @@ pub fn recv<T: Owned>(p: Port<T>) -> T { recv_((**p).po) }
pub fn peek<T: Owned>(p: Port<T>) -> bool { peek_((**p).po) }
#[doc(hidden)]
-pub fn recv_chan<T: Owned>(ch: comm::Chan<T>) -> T {
+pub fn recv_chan<T: Owned>(ch: Chan<T>) -> T {
as_raw_port(ch, |x|recv_(x))
}
-fn peek_chan<T: Owned>(ch: comm::Chan<T>) -> bool {
+fn peek_chan<T: Owned>(ch: Chan<T>) -> bool {
as_raw_port(ch, |x|peek_(x))
}
View
@@ -133,36 +133,36 @@ mod global_env {
}
enum Msg {
- MsgGetEnv(~str, comm::Chan<Option<~str>>),
- MsgSetEnv(~str, ~str, comm::Chan<()>),
- MsgEnv(comm::Chan<~[(~str,~str)]>)
+ MsgGetEnv(~str, oldcomm::Chan<Option<~str>>),
+ MsgSetEnv(~str, ~str, oldcomm::Chan<()>),
+ MsgEnv(oldcomm::Chan<~[(~str,~str)]>)
}
pub fn getenv(n: &str) -> Option<~str> {
let env_ch = get_global_env_chan();
- let po = comm::Port();
- comm::send(env_ch, MsgGetEnv(str::from_slice(n),
- comm::Chan(&po)));
- comm::recv(po)
+ let po = oldcomm::Port();
+ oldcomm::send(env_ch, MsgGetEnv(str::from_slice(n),
+ oldcomm::Chan(&po)));
+ oldcomm::recv(po)
}
pub fn setenv(n: &str, v: &str) {
let env_ch = get_global_env_chan();
- let po = comm::Port();
- comm::send(env_ch, MsgSetEnv(str::from_slice(n),
+ let po = oldcomm::Port();
+ oldcomm::send(env_ch, MsgSetEnv(str::from_slice(n),
str::from_slice(v),
- comm::Chan(&po)));
- comm::recv(po)
+ oldcomm::Chan(&po)));
+ oldcomm::recv(po)
}
pub fn env() -> ~[(~str,~str)] {
let env_ch = get_global_env_chan();
- let po = comm::Port();
- comm::send(env_ch, MsgEnv(comm::Chan(&po)));
- comm::recv(po)
+ let po = oldcomm::Port();
+ oldcomm::send(env_ch, MsgEnv(oldcomm::Chan(&po)));
+ oldcomm::recv(po)
}
- fn get_global_env_chan() -> comm::Chan<Msg> {
+ fn get_global_env_chan() -> oldcomm::Chan<Msg> {
let global_ptr = rustrt::rust_global_env_chan_ptr();
unsafe {
private::chan_from_global_ptr(global_ptr, || {
@@ -173,19 +173,19 @@ mod global_env {
}
}
- fn global_env_task(msg_po: comm::Port<Msg>) {
+ fn global_env_task(msg_po: oldcomm::Port<Msg>) {
unsafe {
do private::weaken_task |weak_po| {
loop {
- match comm::select2(msg_po, weak_po) {
+ match oldcomm::select2(msg_po, weak_po) {
either::Left(MsgGetEnv(ref n, resp_ch)) => {
- comm::send(resp_ch, impl_::getenv(*n))
+ oldcomm::send(resp_ch, impl_::getenv(*n))
}
either::Left(MsgSetEnv(ref n, ref v, resp_ch)) => {
- comm::send(resp_ch, impl_::setenv(*n, *v))
+ oldcomm::send(resp_ch, impl_::setenv(*n, *v))
}
either::Left(MsgEnv(resp_ch)) => {
- comm::send(resp_ch, impl_::env())
+ oldcomm::send(resp_ch, impl_::env())
}
either::Right(_) => break
}
View
@@ -55,8 +55,8 @@ fn compare_and_swap(address: &mut int, oldval: int, newval: int) -> bool {
pub unsafe fn chan_from_global_ptr<T: Owned>(
global: GlobalPtr,
task_fn: fn() -> task::TaskBuilder,
- f: fn~(comm::Port<T>)
-) -> comm::Chan<T> {
+ f: fn~(oldcomm::Port<T>)
+) -> oldcomm::Chan<T> {
enum Msg {
Proceed,
@@ -74,12 +74,12 @@ pub unsafe fn chan_from_global_ptr<T: Owned>(
let (setup2_po, setup2_ch) = pipes::stream();
// XXX: Ugly type inference hints
- let setup1_po: pipes::Port<comm::Chan<T>> = setup1_po;
+ let setup1_po: pipes::Port<oldcomm::Chan<T>> = setup1_po;
let setup2_po: pipes::Port<Msg> = setup2_po;
do task_fn().spawn |move f, move setup1_ch, move setup2_po| {
- let po = comm::Port::<T>();
- let ch = comm::Chan(&po);
+ let po = oldcomm::Port::<T>();
+ let ch = oldcomm::Chan(&po);
setup1_ch.send(ch);
// Wait to hear if we are the official instance of
@@ -130,29 +130,29 @@ pub fn test_from_global_chan1() {
// Create the global channel, attached to a new task
let ch = unsafe {
do chan_from_global_ptr(globchanp, task::task) |po| {
- let ch = comm::recv(po);
- comm::send(ch, true);
- let ch = comm::recv(po);
- comm::send(ch, true);
+ let ch = oldcomm::recv(po);
+ oldcomm::send(ch, true);
+ let ch = oldcomm::recv(po);
+ oldcomm::send(ch, true);
}
};
// Talk to it
- let po = comm::Port();
- comm::send(ch, comm::Chan(&po));
- assert comm::recv(po) == true;
+ let po = oldcomm::Port();
+ oldcomm::send(ch, oldcomm::Chan(&po));
+ assert oldcomm::recv(po) == true;
// This one just reuses the previous channel
let ch = unsafe {
do chan_from_global_ptr(globchanp, task::task) |po| {
- let ch = comm::recv(po);
- comm::send(ch, false);
+ let ch = oldcomm::recv(po);
+ oldcomm::send(ch, false);
}
};
// Talk to the original global task
- let po = comm::Port();
- comm::send(ch, comm::Chan(&po));
- assert comm::recv(po) == true;
+ let po = oldcomm::Port();
+ oldcomm::send(ch, oldcomm::Chan(&po));
+ assert oldcomm::recv(po) == true;
}
#[test]
@@ -163,8 +163,8 @@ pub fn test_from_global_chan2() {
let globchan = 0;
let globchanp = ptr::addr_of(&globchan);
- let resultpo = comm::Port();
- let resultch = comm::Chan(&resultpo);
+ let resultpo = oldcomm::Port();
+ let resultch = oldcomm::Chan(&resultpo);
// Spawn a bunch of tasks that all want to compete to
// create the global channel
@@ -175,23 +175,23 @@ pub fn test_from_global_chan2() {
globchanp, task::task) |po| {
for uint::range(0, 10) |_j| {
- let ch = comm::recv(po);
- comm::send(ch, {i});
+ let ch = oldcomm::recv(po);
+ oldcomm::send(ch, {i});
}
}
};
- let po = comm::Port();
- comm::send(ch, comm::Chan(&po));
+ let po = oldcomm::Port();
+ oldcomm::send(ch, oldcomm::Chan(&po));
// We are The winner if our version of the
// task was installed
- let winner = comm::recv(po);
- comm::send(resultch, winner == i);
+ let winner = oldcomm::recv(po);
+ oldcomm::send(resultch, winner == i);
}
}
// There should be only one winner
let mut winners = 0u;
for uint::range(0u, 10u) |_i| {
- let res = comm::recv(resultpo);
+ let res = oldcomm::recv(resultpo);
if res { winners += 1u };
}
assert winners == 1u;
@@ -217,23 +217,23 @@ pub fn test_from_global_chan2() {
* * Weak tasks must not be supervised. A supervised task keeps
* a reference to its parent, so the parent will not die.
*/
-pub unsafe fn weaken_task(f: fn(comm::Port<()>)) {
- let po = comm::Port();
- let ch = comm::Chan(&po);
+pub unsafe fn weaken_task(f: fn(oldcomm::Port<()>)) {
+ let po = oldcomm::Port();
+ let ch = oldcomm::Chan(&po);
unsafe {
rustrt::rust_task_weaken(cast::reinterpret_cast(&ch));
}
let _unweaken = Unweaken(ch);
f(po);
struct Unweaken {
- ch: comm::Chan<()>,
+ ch: oldcomm::Chan<()>,
drop unsafe {
rustrt::rust_task_unweaken(cast::reinterpret_cast(&self.ch));
}
}
- fn Unweaken(ch: comm::Chan<()>) -> Unweaken {
+ fn Unweaken(ch: oldcomm::Chan<()>) -> Unweaken {
Unweaken {
ch: ch
}
@@ -255,7 +255,7 @@ pub fn test_weaken_task_wait() {
do task::spawn_unlinked {
unsafe {
do weaken_task |po| {
- comm::recv(po);
+ oldcomm::recv(po);
}
}
}
@@ -275,7 +275,7 @@ pub fn test_weaken_task_stress() {
unsafe {
do weaken_task |po| {
// Wait for it to tell us to die
- comm::recv(po);
+ oldcomm::recv(po);
}
}
}
View
@@ -307,22 +307,22 @@ pub fn program_output(prog: &str, args: &[~str]) ->
// in parallel so we don't deadlock while blocking on one
// or the other. FIXME (#2625): Surely there's a much more
// clever way to do this.
- let p = comm::Port();
- let ch = comm::Chan(&p);
+ let p = oldcomm::Port();
+ let ch = oldcomm::Chan(&p);
do task::spawn_sched(task::SingleThreaded) {
let errput = readclose(pipe_err.in);
- comm::send(ch, (2, move errput));
+ oldcomm::send(ch, (2, move errput));
};
do task::spawn_sched(task::SingleThreaded) {
let output = readclose(pipe_out.in);
- comm::send(ch, (1, move output));
+ oldcomm::send(ch, (1, move output));
};
let status = run::waitpid(pid);
let mut errs = ~"";
let mut outs = ~"";
let mut count = 2;
while count > 0 {
- let stream = comm::recv(p);
+ let stream = oldcomm::recv(p);
match stream {
(1, copy s) => {
outs = move s;
Oops, something went wrong.

0 comments on commit e6d1b02

Please sign in to comment.