Fix mutex being unlocked twice.

This commit is contained in:
Ari Koivula 2015-05-27 17:30:42 +03:00
parent 80ec1fda3a
commit cdb66baf16

View file

@ -107,7 +107,6 @@ static void* threadqueue_worker(void* threadqueue_worker_spec_opaque) {
//Find a task (should be fast enough) //Find a task (should be fast enough)
job = NULL; job = NULL;
if (next_job) { if (next_job) {
PTHREAD_LOCK(&next_job->lock);
assert(next_job->ndepends == 0); assert(next_job->ndepends == 0);
job = next_job; job = next_job;
} else { } else {
@ -146,8 +145,6 @@ static void* threadqueue_worker(void* threadqueue_worker_spec_opaque) {
++threadqueue->queue_running; ++threadqueue->queue_running;
} }
//We can unlock the job here, since fptr and arg are constant
PTHREAD_UNLOCK(&job->lock);
//Unlock the queue //Unlock the queue
PTHREAD_UNLOCK(&threadqueue->lock); PTHREAD_UNLOCK(&threadqueue->lock);