mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: replace go with spawn
This commit is contained in:
@@ -38,7 +38,7 @@ fn main() {
|
||||
mut no := nobj
|
||||
for i in 0 .. nrec {
|
||||
n := no / (nrec - i)
|
||||
go do_rec(ch, resch, n)
|
||||
spawn do_rec(ch, resch, n)
|
||||
no -= n
|
||||
}
|
||||
$if debug {
|
||||
@@ -49,7 +49,7 @@ fn main() {
|
||||
n := no / (nsend - i)
|
||||
end := no
|
||||
no -= n
|
||||
go do_send(ch, no, end)
|
||||
spawn do_send(ch, no, end)
|
||||
}
|
||||
assert no == 0
|
||||
mut sum := i64(0)
|
||||
|
||||
@@ -117,11 +117,11 @@ fn main() {
|
||||
}
|
||||
ctx.pops_wg.add(n_readers)
|
||||
for i := 0; i < n_readers; i++ {
|
||||
go do_rec(ch, i, mut ctx)
|
||||
spawn do_rec(ch, i, mut ctx)
|
||||
}
|
||||
ctx.pushes_wg.add(n_writers)
|
||||
for i := 0; i < n_writers; i++ {
|
||||
go do_send(ch, i, mut ctx)
|
||||
spawn do_send(ch, i, mut ctx)
|
||||
}
|
||||
ctx.pushes_wg.wait()
|
||||
eprintln('>> all pushes done')
|
||||
|
||||
Reference in New Issue
Block a user