Skip to content

Commit 5e18c26

Browse files
committed
---
yaml --- r: 29742 b: refs/heads/incoming c: d2e9d99 h: refs/heads/master v: v3
1 parent ec26896 commit 5e18c26

File tree

3 files changed

+31
-4
lines changed

3 files changed

+31
-4
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: 7634e2911b6cedd7d06bbfd716922c4a750b47ae
9+
refs/heads/incoming: d2e9d99f819e04d32fe8f87dab9e3b318075cf26
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -530,16 +530,20 @@ fn sender_terminate<T: send>(p: *packet<T>) {
530530
#[doc(hidden)]
531531
fn receiver_terminate<T: send>(p: *packet<T>) {
532532
let p = unsafe { &*p };
533-
assert p.header.blocked_task.is_null();
534533
match swap_state_rel(p.header.state, terminated) {
535534
empty => {
535+
assert p.header.blocked_task.is_null();
536536
// the sender will clean up
537537
}
538538
blocked => {
539-
// this shouldn't happen.
540-
fail ~"terminating a blocked packet"
539+
let old_task = swap_task(p.header.blocked_task, ptr::null());
540+
if !old_task.is_null() {
541+
rustrt::rust_task_deref(old_task);
542+
assert old_task == rustrt::rust_get_task();
543+
}
541544
}
542545
terminated | full => {
546+
assert p.header.blocked_task.is_null();
543547
// I have to clean up, use drop_glue
544548
}
545549
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pipes::{select2, selectable};
2+
3+
fn main() {
4+
let (c,p) = pipes::stream();
5+
do task::try {
6+
let (c2,p2) = pipes::stream();
7+
do task::spawn {
8+
p2.recv();
9+
#error["brother fails"];
10+
fail;
11+
}
12+
let (c3,p3) = pipes::stream();
13+
c.send(c3);
14+
c2.send(());
15+
#error["child blocks"];
16+
let (c, p) = pipes::stream();
17+
(p, p3).select();
18+
c.send(());
19+
};
20+
#error["parent tries"];
21+
assert !p.recv().try_send(());
22+
#error("all done!");
23+
}

0 commit comments

Comments
 (0)