simplify example
parent
b4b7224dd0
commit
495c08602f
|
@ -13,11 +13,7 @@ void foo() {
|
||||||
|
|
||||||
auto c = sched.make_channel<int>();
|
auto c = sched.make_channel<int>();
|
||||||
auto f = [&c](auto half) {
|
auto f = [&c](auto half) {
|
||||||
int ret = 0;
|
c.put(foldl(half, 0));
|
||||||
for (int i: half) {
|
|
||||||
ret += i;
|
|
||||||
}
|
|
||||||
c.put(ret);
|
|
||||||
};
|
};
|
||||||
sched.spawn(f, h1);
|
sched.spawn(f, h1);
|
||||||
sched.spawn(f, h2);
|
sched.spawn(f, h2);
|
||||||
|
|
Loading…
Reference in New Issue