libresman

diff src/threadpool.c @ 12:84f55eab27cb

ok now it sortof works, probably something is failing in the done callback mechanism
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 08 Feb 2014 04:21:08 +0200
parents bebc065a941f
children 2b8281a146af
line diff
     1.1 --- a/src/threadpool.c	Fri Feb 07 07:50:02 2014 +0200
     1.2 +++ b/src/threadpool.c	Sat Feb 08 04:21:08 2014 +0200
     1.3 @@ -122,8 +122,10 @@
     1.4  		tpool->work_list_tail->next = node;
     1.5  		tpool->work_list_tail = node;
     1.6  	}
     1.7 +	pthread_mutex_unlock(&tpool->work_lock);
     1.8  
     1.9 -	pthread_mutex_unlock(&tpool->work_lock);
    1.10 +	/* wakeup all threads, there's work to do */
    1.11 +	pthread_cond_broadcast(&tpool->work_cond);
    1.12  	return 0;
    1.13  }
    1.14