Skip to content

Commit

Permalink
Merge pull request rust-lang#4503 from nickdesaulniers/incoming
Browse files Browse the repository at this point in the history
Swap return value order in pipes::oneshot Issue rust-lang#4496
  • Loading branch information
brson committed Jan 16, 2013
2 parents e90142e + bb7d720 commit a7f422d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/libcore/pipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1229,8 +1229,9 @@ pub type ChanOne<T: Owned> = oneshot::client::Oneshot<T>;
pub type PortOne<T: Owned> = oneshot::server::Oneshot<T>;

/// Initialiase a (send-endpoint, recv-endpoint) oneshot pipe pair.
pub fn oneshot<T: Owned>() -> (ChanOne<T>, PortOne<T>) {
oneshot::init()
pub fn oneshot<T: Owned>() -> (PortOne<T>, ChanOne<T>) {
let (chan, port) = oneshot::init();
(port, chan)
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/private.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,8 @@ pub unsafe fn unwrap_shared_mutable_state<T: Owned>(rc: SharedMutableState<T>)

do task::unkillable {
let ptr: ~ArcData<T> = cast::reinterpret_cast(&rc.data);
let (c1,p1) = pipes::oneshot(); // ()
let (c2,p2) = pipes::oneshot(); // bool
let (p1,c1) = pipes::oneshot(); // ()
let (p2,c2) = pipes::oneshot(); // bool
let server: UnwrapProto = ~mut Some((move c1,move p2));
let serverp: int = cast::transmute(move server);
// Try to put our server end in the unwrapper slot.
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ mod tests {
fn test_mutex_arc_condvar() {
let arc = ~MutexARC(false);
let arc2 = ~arc.clone();
let (c,p) = pipes::oneshot();
let (p,c) = pipes::oneshot();
let (c,p) = (~mut Some(move c), ~mut Some(move p));
do task::spawn |move arc2, move p| {
// wait until parent gets in
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<Q: Owned> &Sem<Q> {
state.count -= 1;
if state.count < 0 {
// Create waiter nobe.
let (SignalEnd, WaitEnd) = pipes::oneshot();
let (WaitEnd, SignalEnd) = pipes::oneshot();
// Tell outer scope we need to block.
waiter_nobe = Some(move WaitEnd);
// Enqueue ourself.
Expand Down Expand Up @@ -216,7 +216,7 @@ impl &Condvar {
*/
fn wait_on(condvar_id: uint) {
// Create waiter nobe.
let (SignalEnd, WaitEnd) = pipes::oneshot();
let (WaitEnd, SignalEnd) = pipes::oneshot();
let mut WaitEnd = Some(move WaitEnd);
let mut SignalEnd = Some(move SignalEnd);
let mut reacquire = None;
Expand Down

0 comments on commit a7f422d

Please sign in to comment.