From 59002e7bea266c024fa343524c58c6a2fea5895c Mon Sep 17 00:00:00 2001 From: "William M. Brack" Date: Fri, 4 Jul 2003 17:01:59 +0000 Subject: [PATCH] Fixed multithreading problem --- ChangeLog | 11 +++++++++++ catalog.c | 4 +++- threads.c | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6f769dd6..6f347853 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Sat Jul 5 00:51:30 HKT 2003 William Brack + + Fixed problem with multi-threading, shown by the test program + testThreads. After fix, ran mutiple tests on various speed + machines (single and dual processor X86), which all seem okay. + + * catalog.c: added missing xmlRMutexUnlock in xmlLoadCatalog + + * threads.c: added missing initialisation for condition variable + in xmlNewRMutex. + Sat Jun 21 16:10:24 CEST 2003 Daniel Veillard Applying IPv6 patch from Archana Shah diff --git a/catalog.c b/catalog.c index 29f98d29..06bffc66 100644 --- a/catalog.c +++ b/catalog.c @@ -2909,8 +2909,10 @@ xmlLoadCatalog(const char *filename) if (xmlDefaultCatalog == NULL) { catal = xmlLoadACatalog(filename); - if (catal == NULL) + if (catal == NULL) { + xmlRMutexUnlock(xmlCatalogMutex); return(-1); + } xmlDefaultCatalog = catal; xmlRMutexUnlock(xmlCatalogMutex); diff --git a/threads.c b/threads.c index a1263fcd..777339cc 100644 --- a/threads.c +++ b/threads.c @@ -196,6 +196,7 @@ xmlNewRMutex(void) pthread_mutex_init(&tok->lock, NULL); tok->held = 0; tok->waiters = 0; + pthread_cond_init(&tok->cv, NULL); #elif defined HAVE_WIN32_THREADS InitializeCriticalSection(&tok->cs); tok->count = 0;