From 4fbaee45f4bc2fc06d5e7e5fc2d284d6535004d9 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 24 Aug 2021 23:10:45 -0700 Subject: iou: don't loop until n_async depletes This wasn't right, if there's actually a backlog of async jobs this could hold up progress for non-async completions for no good reason. Just do completions for whatever is present in the processed list, don't potentially wait. --- src/iou.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iou.c b/src/iou.c index 1ce9af1..b28d8f6 100644 --- a/src/iou.c +++ b/src/iou.c @@ -349,7 +349,7 @@ int iou_run(iou_t *iou) return r; /* complete any processed async work */ - while (iou->n_async) { + if (iou->n_async) { pthread_mutex_lock(&iou->processed_mutex); _op = iou->processed; -- cgit v1.2.3