sync: run sync.pool without using concurrency features when VJOBS=1
parent
640bbbae85
commit
cf4dc93e02
|
@ -118,7 +118,12 @@ pub fn (mut pool PoolProcessor) work_on_pointers(items []voidptr) {
|
||||||
pool.thread_contexts << [voidptr(0)].repeat(pool.items.len)
|
pool.thread_contexts << [voidptr(0)].repeat(pool.items.len)
|
||||||
pool.waitgroup.add(njobs)
|
pool.waitgroup.add(njobs)
|
||||||
for i := 0; i < njobs; i++ {
|
for i := 0; i < njobs; i++ {
|
||||||
|
if njobs > 1 {
|
||||||
go process_in_thread(mut pool,i)
|
go process_in_thread(mut pool,i)
|
||||||
|
} else {
|
||||||
|
// do not run concurrently, just use the same thread:
|
||||||
|
process_in_thread(mut pool,i)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pool.waitgroup.wait()
|
pool.waitgroup.wait()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue