sync: protect against sporadic failing tests in macos

pull/3968/head
Delyan Angelov 2020-03-08 16:40:50 +02:00 committed by GitHub
parent ee6f2f84bb
commit 8df265a581
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -135,6 +135,9 @@ fn process_in_thread(pool mut PoolProcessor, task_id int) {
idx = pool.ntask
pool.ntask++
pool.ntask_mtx.unlock()
if idx >= ilen {
break
}
pool.results[idx] = cb(pool, idx, task_id)
}
pool.waitgroup.done()