Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Dec 13 00:44:57 CET 2017 on sn-devel-144
* Add job to the end of the queue
*/
if (!pthreadpool_put_job(pool, job_id, fn, private_data)) {
* Add job to the end of the queue
*/
if (!pthreadpool_put_job(pool, job_id, fn, private_data)) {
- pthread_mutex_unlock(&pool->mutex);
+ res = pthread_mutex_unlock(&pool->mutex);
+ assert(res == 0);
return ENOMEM;
}
if (pool->num_idle > 0) {
return ENOMEM;
}
if (pool->num_idle > 0) {
/*
* We have idle threads, wake one.
*/
/*
* We have idle threads, wake one.
*/
if (res != 0) {
pthreadpool_undo_put_job(pool);
}
if (res != 0) {
pthreadpool_undo_put_job(pool);
}
- pthread_mutex_unlock(&pool->mutex);
+ unlock_res = pthread_mutex_unlock(&pool->mutex);
+ assert(unlock_res == 0);
/*
* No more new threads, we just queue the request
*/
/*
* No more new threads, we just queue the request
*/
- pthread_mutex_unlock(&pool->mutex);
+ res = pthread_mutex_unlock(&pool->mutex);
+ assert(res == 0);