Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6aa50c5

Browse files
committed
threadpool: avoid double check
Instead, exit the loop when `progress()` returns an error.
1 parent 43af502 commit 6aa50c5

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

libvips/iofuncs/threadpool.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,12 +666,10 @@ vips_threadpool_run(VipsImage *im,
666666
break;
667667

668668
if (progress &&
669-
progress(pool->a))
669+
progress(pool->a)) {
670670
g_atomic_int_set(&pool->error, TRUE);
671-
672-
if (g_atomic_int_get(&pool->stop) ||
673-
g_atomic_int_get(&pool->error))
674671
break;
672+
}
675673

676674
n_waiting = g_atomic_int_get(&pool->n_waiting);
677675
VIPS_DEBUG_MSG("n_waiting = %d\n", n_waiting);

0 commit comments

Comments
 (0)