From 78580651131c9daacd7e5e4669af819cdd719f09 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sun, 9 Mar 2014 14:58:32 -0700 Subject: std: Rename Chan/Port types and constructor * Chan => Sender * Port => Receiver * 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 --- src/libstd/sync/mpsc_queue.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/libstd/sync/mpsc_queue.rs') diff --git a/src/libstd/sync/mpsc_queue.rs b/src/libstd/sync/mpsc_queue.rs index 2dc63380cb8..9d69f2b3b08 100644 --- a/src/libstd/sync/mpsc_queue.rs +++ b/src/libstd/sync/mpsc_queue.rs @@ -176,17 +176,17 @@ mod tests { Empty => {} Inconsistent | Data(..) => fail!() } - let (port, chan) = Chan::new(); + let (tx, rx) = channel(); let q = UnsafeArc::new(q); for _ in range(0, nthreads) { - let chan = chan.clone(); + let tx = tx.clone(); let q = q.clone(); native::task::spawn(proc() { for i in range(0, nmsgs) { unsafe { (*q.get()).push(i); } } - chan.send(()); + tx.send(()); }); } @@ -197,9 +197,9 @@ mod tests { Data(_) => { i += 1 } } } - drop(chan); + drop(tx); for _ in range(0, nthreads) { - port.recv(); + rx.recv(); } } } -- cgit 1.4.1-3-g733a5