Commit b8fda6bb authored by Xavier Thompson's avatar Xavier Thompson

Adapt exception.cpp and forkjoin_fibo.cpp

parent 0f01b72d
...@@ -25,7 +25,7 @@ Join<void> fail_join() { ...@@ -25,7 +25,7 @@ Join<void> fail_join() {
} }
Join<void> join(int max) { Join<void> join(int max) {
std::vector<Async<int>> v; std::vector<Forked<int>> v;
for (int i = 0; i < max; i++) { for (int i = 0; i < max; i++) {
v.push_back(co_await fork(fib())); v.push_back(co_await fork(fib()));
} }
......
...@@ -8,8 +8,8 @@ Join<int> fibo(int n) { ...@@ -8,8 +8,8 @@ Join<int> fibo(int n) {
if (n < 2) { if (n < 2) {
co_return n; co_return n;
} }
Async a = co_await fork(fibo(n - 1)); Forked a = co_await fork(fibo(n - 1));
Async b = co_await fork(fibo(n - 2)); Forked b = co_await fork(fibo(n - 2));
co_await Sync(); co_await Sync();
co_return a.get() + b.get(); co_return a.get() + b.get();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment