Skip to content

Swap return value order in pipes::oneshot Issue #4496 #4503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 16, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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