From 1317b7c2338777343841e8ea3a83c120bac1747e Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 15 Sep 2011 15:52:14 +0200 Subject: [PATCH] Remove backgroud jobs from the queue only when the processing was completed, and not just started. --- src/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bio.c b/src/bio.c index 145a2324..1657455e 100644 --- a/src/bio.c +++ b/src/bio.c @@ -118,7 +118,6 @@ void *bioProcessBackgroundJobs(void *arg) { /* Pop the job from the queue. */ ln = listFirst(bio_jobs[type]); job = ln->value; - listDelNode(bio_jobs[type],ln); /* It is now possible to unlock the background system as we know have * a stand alone job structure to process.*/ pthread_mutex_unlock(&bio_mutex[type]); @@ -134,6 +133,7 @@ void *bioProcessBackgroundJobs(void *arg) { /* Lock again before reiterating the loop, if there are no longer * jobs to process we'll block again in pthread_cond_wait(). */ pthread_mutex_lock(&bio_mutex[type]); + listDelNode(bio_jobs[type],ln); bio_pending[type]--; } } -- 2.45.2