erofs-utils: optimize pthread_cond_signal calling
PATCH 1/1 erofs-utils: optimize pthread_cond_signal calling
Call pthread_cond_signal once per file.
Signed-off-by Noboru Asai <[email protected]>
--- lib/compress.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
lib/compress.c +2 -2
@@ -1261,8 +1261,8 @@ void z_erofs_mt_workfn(struct erofs_work *work, void *tlsp) out: cwork->errcode = ret;pthread_mutex_lock (&ictx->mutex); - ++ictx->nfini; -pthread_cond_signal (&ictx->cond); +if (++ictx->nfini == ictx->seg_num) +pthread_cond_signal (&ictx->cond);pthread_mutex_unlock (&ictx->mutex); }
Signature · 1 line
2.44.0
Quoted 3 lines · Noboru Asai
Call
pthread_cond_signalonce per file.Signed-off-by Noboru Asai <[email protected]>
Reviewed-by Gao Xiang <[email protected]>
Thanks,
Gao Xiang