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:
@@ -298,7 +298,7 @@ pub fn (mut ts TestSession) test() {
|
||||
ts.nmessages = chan LogMessage{cap: 10000}
|
||||
ts.nprint_ended = chan int{cap: 0}
|
||||
ts.nmessage_idx = 0
|
||||
go ts.print_messages()
|
||||
spawn ts.print_messages()
|
||||
pool_of_test_runners.set_shared_context(ts)
|
||||
pool_of_test_runners.work_on_pointers(unsafe { remaining_files.pointers() })
|
||||
ts.benchmark.stop()
|
||||
|
||||
@@ -73,7 +73,7 @@ fn main() {
|
||||
if ctx.is_verbose {
|
||||
eprintln('> args: $args | context: $ctx')
|
||||
}
|
||||
go do_timeout(&ctx)
|
||||
spawn do_timeout(&ctx)
|
||||
for i := 1; true; i++ {
|
||||
ctx.println('$i')
|
||||
time.sleep(ctx.period_ms * time.millisecond)
|
||||
|
||||
@@ -210,7 +210,7 @@ fn (vd VDoc) render_parallel(out Output) {
|
||||
work.close()
|
||||
wg.add(vjobs)
|
||||
for _ in 0 .. vjobs {
|
||||
go vd.work_processor(mut work, mut wg)
|
||||
spawn vd.work_processor(mut work, mut wg)
|
||||
}
|
||||
wg.wait()
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ fn main() {
|
||||
mut source := os.read_file(context.path)!
|
||||
source = source[..context.cut_index]
|
||||
|
||||
go fn (ms int) {
|
||||
spawn fn (ms int) {
|
||||
time.sleep(ms * time.millisecond)
|
||||
exit(ecode_timeout)
|
||||
}(context.timeout_ms)
|
||||
@@ -248,7 +248,7 @@ fn (mut context Context) start_printing() {
|
||||
if !context.is_linear && !context.is_silent {
|
||||
println('\n')
|
||||
}
|
||||
go context.print_periodic_status()
|
||||
spawn context.print_periodic_status()
|
||||
}
|
||||
|
||||
fn (mut context Context) stop_printing() {
|
||||
|
||||
@@ -381,6 +381,6 @@ fn (mut context Context) worker_main() {
|
||||
context.is_exiting = true
|
||||
context.kill_pgroup()
|
||||
}) or { panic(err) }
|
||||
go context.compilation_runner_loop()
|
||||
spawn context.compilation_runner_loop()
|
||||
change_detection_loop(context)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user