Remove lock in ThreadPoolInit

If ThreadPoolInit returned EAGAIN, tp->lock was not freed.
(cherry picked from commit d45f3c28cfb9e1fe167bea66ef0fdd0d0b218bb3)
This commit is contained in:
Fabrice Fontaine 2012-03-10 18:09:37 +01:00 committed by Marcelo Roberto Jimenez
parent 404867107d
commit 24f12e3ce0
2 changed files with 10 additions and 0 deletions

View File

@ -318,6 +318,12 @@ Version 1.8.0
Version 1.6.16
*******************************************************************************
2012-03-10 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
Remove lock in ThreadPoolInit
If ThreadPoolInit returned EAGAIN, tp->lock was not freed.
2012-03-10 Fabrice Fontaine <fabrice.fontaine(at)orange.com>
Improve ixml

View File

@ -707,6 +707,10 @@ int ThreadPoolInit(ThreadPool *tp, ThreadPoolAttr *attr)
retCode += ithread_cond_init(&tp->condition, NULL);
retCode += ithread_cond_init(&tp->start_and_shutdown, NULL);
if (retCode) {
ithread_mutex_unlock(&tp->mutex);
ithread_mutex_destroy(&tp->mutex);
ithread_cond_destroy(&tp->condition);
ithread_cond_destroy(&tp->start_and_shutdown);
return EAGAIN;
}
if (attr) {