Skip to content

Commit e5f9090

Browse files
committed
---
yaml --- r: 29885 b: refs/heads/incoming c: 942649a h: refs/heads/master i: 29883: 5beed8c v: v3
1 parent cb48435 commit e5f9090

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: b206920d9d8c46ee38d3d3930afc57d2a0cfb3f7
9+
refs/heads/incoming: 942649a26073bb84797f8831d39d0b35018e931b
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/libcore/pipes.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -581,14 +581,14 @@ that vector. The index points to an endpoint that has either been
581581
closed by the sender or has a message waiting to be received.
582582
583583
*/
584-
fn wait_many(pkts: &[*packet_header]) -> uint {
584+
fn wait_many<T: selectable>(pkts: &[T]) -> uint {
585585
let this = rustrt::rust_get_task();
586586

587587
rustrt::task_clear_event_reject(this);
588588
let mut data_avail = false;
589589
let mut ready_packet = pkts.len();
590590
for pkts.eachi |i, p| unsafe {
591-
let p = unsafe { &*p };
591+
let p = unsafe { &*p.header() };
592592
let old = p.mark_blocked(this);
593593
match old {
594594
full | terminated => {
@@ -605,7 +605,7 @@ fn wait_many(pkts: &[*packet_header]) -> uint {
605605
while !data_avail {
606606
debug!{"sleeping on %? packets", pkts.len()};
607607
let event = wait_event(this) as *packet_header;
608-
let pos = vec::position(pkts, |p| p == event);
608+
let pos = vec::position(pkts, |p| p.header() == event);
609609

610610
match pos {
611611
some(i) => {
@@ -618,13 +618,13 @@ fn wait_many(pkts: &[*packet_header]) -> uint {
618618

619619
debug!{"%?", pkts[ready_packet]};
620620

621-
for pkts.each |p| { unsafe{ (*p).unblock()} }
621+
for pkts.each |p| { unsafe{ (*p.header()).unblock()} }
622622

623623
debug!("%?, %?", ready_packet, pkts[ready_packet]);
624624

625625
unsafe {
626-
assert (*pkts[ready_packet]).state == full
627-
|| (*pkts[ready_packet]).state == terminated;
626+
assert (*pkts[ready_packet].header()).state == full
627+
|| (*pkts[ready_packet].header()).state == terminated;
628628
}
629629

630630
ready_packet
@@ -686,7 +686,7 @@ impl *packet_header: selectable {
686686

687687
/// Returns the index of an endpoint that is ready to receive.
688688
fn selecti<T: selectable>(endpoints: &[T]) -> uint {
689-
wait_many(endpoints.map(|p| p.header()))
689+
wait_many(endpoints)
690690
}
691691

692692
/// Returns 0 or 1 depending on which endpoint is ready to receive

0 commit comments

Comments
 (0)