X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fjobs.c;h=2910f0a30da14fc991aeb89286736b7eabc5ac79;hb=48827b7b9862ab5961f938f38a8667e15421a50c;hp=1be6ec7b487159454d8a71e68112e06dde969a02;hpb=f9fc4077cc0eb167f3e65f54cc27717c79beee92;p=src%2Fapp-framework-binder.git diff --git a/src/jobs.c b/src/jobs.c index 1be6ec7b..2910f0a3 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -146,7 +146,9 @@ static struct job *job_create( /* allocates the job */ job = free_jobs; - if (!job) { + if (job) + free_jobs = job->next; + else { pthread_mutex_unlock(&mutex); job = malloc(sizeof *job); pthread_mutex_lock(&mutex); @@ -369,7 +371,7 @@ int jobs_init(int allowed_count, int start_count, int waiter_count) } /* terminate all the threads and all pending requests */ -void jobs_terminate() +void jobs_terminate(int wait) { struct job *job; pthread_t me, other;