1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

v2: fix support for 'go fn()' in modules. sync.pool is again multithreaded.

This commit is contained in:
Delyan Angelov
2020-04-03 19:44:49 +03:00
parent c32ed8af51
commit b411d29577
2 changed files with 17 additions and 14 deletions

View File

@ -116,9 +116,7 @@ pub fn (pool mut PoolProcessor) work_on_pointers(items []voidptr) {
pool.thread_contexts << [voidptr(0)].repeat(pool.items.len)
pool.waitgroup.add(njobs)
for i := 0; i < njobs; i++ {
// TODO: uncomment when `go func()` works again with v2
// go process_in_thread(pool,i)
process_in_thread(pool,i)
go process_in_thread(pool,i)
}
pool.waitgroup.wait()
}
@ -217,11 +215,11 @@ pub fn (pool &PoolProcessor) get_thread_context(idx int) voidptr {
// TODO: remove everything below this line after generics are fixed:
pub struct SResult {
pub:
pub:
s string
}
pub struct IResult {
pub:
pub:
i int
}