Skip to content

Commit 4da2e91

Browse files
committed
---
yaml --- r: 27649 b: refs/heads/try c: c5fbff0 h: refs/heads/master i: 27647: 180fd6d v: v3
1 parent 18e42ef commit 4da2e91

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: bc6ba6b09174fdd1feaee1ce011572ba6eb1986a
5+
refs/heads/try: c5fbff01ce2b3e2d3020182891d4a22b8958f7f3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/src/libcore/pipes.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,20 @@ fn try_recv<T: send, Tbuffer: send>(-p: recv_packet_buffered<T, Tbuffer>)
395395
{
396396
let p_ = p.unwrap();
397397
let p = unsafe { &*p_ };
398+
399+
// optimistic path
400+
match p.header.state {
401+
full => {
402+
let mut payload = none;
403+
payload <-> p.payload;
404+
p.header.state = empty;
405+
return some(option::unwrap(payload))
406+
},
407+
terminated => return none,
408+
_ => {}
409+
}
410+
411+
// regular path
398412
let this = rustrt::rust_get_task();
399413
rustrt::task_clear_event_reject(this);
400414
rustrt::rust_task_ref(this);

0 commit comments

Comments
 (0)