about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-13 14:06:37 -0700
committerbors <bors@rust-lang.org>2014-03-13 14:06:37 -0700
commitb4d324334cb48198c27d782002d75eba14a6abde (patch)
tree950d8daa5e6305090bdd69625bb18ead48471865 /src/libstd/rt
parent6ff3c9995e63b63c16d13739a0fc2d321f95410e (diff)
parent78580651131c9daacd7e5e4669af819cdd719f09 (diff)
downloadrust-b4d324334cb48198c27d782002d75eba14a6abde.tar.gz
rust-b4d324334cb48198c27d782002d75eba14a6abde.zip
auto merge of #12815 : alexcrichton/rust/chan-rename, r=brson
* Chan<T> => Sender<T>
* Port<T> => Receiver<T>
* Chan::new() => channel()
* constructor returns (Sender, Receiver) instead of (Receiver, Sender)
* local variables named `port` renamed to `rx`
* local variables named `chan` renamed to `tx`

Closes #11765
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/rtio.rs8
-rw-r--r--src/libstd/rt/task.rs16
2 files changed, 12 insertions, 12 deletions
diff --git a/src/libstd/rt/rtio.rs b/src/libstd/rt/rtio.rs
index edb480fe4cb..cd557f01834 100644
--- a/src/libstd/rt/rtio.rs
+++ b/src/libstd/rt/rtio.rs
@@ -10,7 +10,7 @@
 
 use c_str::CString;
 use cast;
-use comm::{Chan, Port};
+use comm::{Sender, Receiver};
 use libc::c_int;
 use libc;
 use ops::Drop;
@@ -183,7 +183,7 @@ pub trait IoFactory {
     fn pipe_open(&mut self, fd: c_int) -> Result<~RtioPipe, IoError>;
     fn tty_open(&mut self, fd: c_int, readable: bool)
             -> Result<~RtioTTY, IoError>;
-    fn signal(&mut self, signal: Signum, channel: Chan<Signum>)
+    fn signal(&mut self, signal: Signum, channel: Sender<Signum>)
         -> Result<~RtioSignal, IoError>;
 }
 
@@ -233,8 +233,8 @@ pub trait RtioUdpSocket : RtioSocket {
 
 pub trait RtioTimer {
     fn sleep(&mut self, msecs: u64);
-    fn oneshot(&mut self, msecs: u64) -> Port<()>;
-    fn period(&mut self, msecs: u64) -> Port<()>;
+    fn oneshot(&mut self, msecs: u64) -> Receiver<()>;
+    fn period(&mut self, msecs: u64) -> Receiver<()>;
 }
 
 pub trait RtioFileStream {
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index 72ba98eab4f..86e69560e9d 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -17,7 +17,7 @@ use any::AnyOwnExt;
 use cast;
 use cleanup;
 use clone::Clone;
-use comm::Chan;
+use comm::Sender;
 use io::Writer;
 use iter::{Iterator, Take};
 use local_data;
@@ -73,7 +73,7 @@ pub enum DeathAction {
     /// until all its watched children exit before collecting the status.
     Execute(proc(TaskResult)),
     /// A channel to send the result of the task on when the task exits
-    SendMessage(Chan<TaskResult>),
+    SendMessage(Sender<TaskResult>),
 }
 
 /// Per-task state related to task death, killing, failure, etc.
@@ -450,16 +450,16 @@ mod test {
 
     #[test]
     fn comm_stream() {
-        let (port, chan) = Chan::new();
-        chan.send(10);
-        assert!(port.recv() == 10);
+        let (tx, rx) = channel();
+        tx.send(10);
+        assert!(rx.recv() == 10);
     }
 
     #[test]
     fn comm_shared_chan() {
-        let (port, chan) = Chan::new();
-        chan.send(10);
-        assert!(port.recv() == 10);
+        let (tx, rx) = channel();
+        tx.send(10);
+        assert!(rx.recv() == 10);
     }
 
     #[test]