blob: 6d687e4f2113e84351ae40866663a169e9697d13 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
fn expensive_computing(i int) int {
return i * i
}
fn main() {
mut threads := []thread int{}
for i in 1 .. 10 {
threads << go expensive_computing(i)
}
// Join all tasks
r := threads.wait()
println('All jobs finished: $r')
}
|