diff options
| -rw-r--r-- | src/libcore/pipes.rs | 5 | ||||
| -rw-r--r-- | src/libcore/private.rs | 4 | ||||
| -rw-r--r-- | src/libstd/arc.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync.rs | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/src/libcore/pipes.rs b/src/libcore/pipes.rs index db730fb52b4..2ff4effbd6e 100644 --- a/src/libcore/pipes.rs +++ b/src/libcore/pipes.rs @@ -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) } /** diff --git a/src/libcore/private.rs b/src/libcore/private.rs index a88a1196935..d3002ba9316 100644 --- a/src/libcore/private.rs +++ b/src/libcore/private.rs @@ -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. diff --git a/src/libstd/arc.rs b/src/libstd/arc.rs index 3463b31c55c..e48dc9acaeb 100644 --- a/src/libstd/arc.rs +++ b/src/libstd/arc.rs @@ -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 diff --git a/src/libstd/sync.rs b/src/libstd/sync.rs index 58bdf8cfa74..f12114bfd8e 100644 --- a/src/libstd/sync.rs +++ b/src/libstd/sync.rs @@ -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. @@ -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; |
