Skip to content

Commit e3a7ee9

Browse files
olsonjefferybrson
authored andcommitted
---
yaml --- r: 28394 b: refs/heads/try c: d41af3e h: refs/heads/master v: v3
1 parent 4c8fe67 commit e3a7ee9

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
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: a8fc771f2004c376bbde68d09ead45d679f8f597
5+
refs/heads/try: d41af3e00229c2c32890360eb760219eeb14e724
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

branches/try/src/libcore/task.rs

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -366,17 +366,22 @@ impl TaskBuilder {
366366
}
367367
368368
// Construct the future and give it to the caller.
369-
let (ch, po) = stream::<Notification>();
369+
let (notify_pipe_ch, notify_pipe_po) = stream::<Notification>();
370370
371371
blk(do future::from_fn {
372-
match po.recv() {
372+
match notify_pipe_po.recv() {
373373
Exit(_, result) => result
374374
}
375375
});
376376
377377
// Reconfigure self to use a notify channel.
378378
TaskBuilder({
379-
opts: { notify_chan: Some(ch),.. self.opts },
379+
opts: {
380+
linked: self.opts.linked,
381+
supervised: self.opts.supervised,
382+
mut notify_chan: Some(notify_pipe_ch),
383+
sched: self.opts.sched
384+
},
380385
can_not_copy: None,
381386
.. *self.consume()
382387
})
@@ -445,12 +450,14 @@ impl TaskBuilder {
445450
* must be greater than zero.
446451
*/
447452
fn spawn(+f: fn~()) {
448-
let x = self.consume();
449-
let notify_chan = if self.opts.notify_chan == None {
453+
let notify_chan = if self.opts.notify_chan == none {
450454
None
451455
} else {
452-
Some(option::swap_unwrap(&mut self.opts.notify_chan))
456+
let swapped_notify_chan =
457+
option::swap_unwrap(&mut self.opts.notify_chan);
458+
some(swapped_notify_chan)
453459
};
460+
let x = self.consume();
454461
let opts = {
455462
linked: x.opts.linked,
456463
supervised: x.opts.supervised,
@@ -522,7 +529,8 @@ impl TaskBuilder {
522529
let ch = comm::Chan(po);
523530
let mut result = None;
524531
525-
do self.future_result(|+r| { result = Some(r); }).spawn {
532+
let fr_task_builder = self.future_result(|+r| { result = Some(r); });
533+
do fr_task_builder.spawn {
526534
comm::send(ch, f());
527535
}
528536
match future::get(&option::unwrap(result)) {

0 commit comments

Comments
 (0)