I have done some debug testing with the 'valgrind' that Kalle
suggested and came accross some points:
==29137==
==29137== 411 errors in context 2 of 2:
==29137== pthread_mutex_destroy: mutex is still in use
==29137== at 0x4029FB7F: pthread_error (vg_libpthread.c:231)
==29137== by 0x402A0A18: __pthread_mutex_destroy
(vg_libpthread.c:848)
==29137== by 0x808C8ED: mutex_destroy (gwlib/thread.c:55)
==29137== by 0x808676E: list_destroy (gwlib/list.c:97)
which refers to the code in gwlib/list.c:
void list_destroy(List *list, list_item_destructor_t *destructor)
{
void *item;
if (list == NULL)
return;
if (destructor != NULL) {
while ((item = list_extract_first(list)) != NULL)
destructor(item);
}
mutex_lock(list->permanent_lock); <------
mutex_destroy(list->permanent_lock);
mutex_destroy(list->single_operation_lock);
pthread_cond_destroy(&list->nonempty);
gw_free(list->tab);
gw_free(list);
}
I guess we should not lock a mutex that is then destroyed, right?!
Stipe
[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG
Vogelsanger Weg 80
40470 D�sseldorf
Tel: +49-211-74845-0
Fax: +49-211-74845-299
E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are