1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-17 18:21:05 +03:00

Fixed multithreading problem

This commit is contained in:
William M. Brack
2003-07-04 17:01:59 +00:00
parent de2a67b430
commit 59002e7bea
3 changed files with 15 additions and 1 deletions

View File

@ -1,3 +1,14 @@
Sat Jul 5 00:51:30 HKT 2003 William Brack <wbrack@mmm.com.hk>
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 <daniel@veillard.com> Sat Jun 21 16:10:24 CEST 2003 Daniel Veillard <daniel@veillard.com>
Applying IPv6 patch from Archana Shah <archana.shah@wipro.com> Applying IPv6 patch from Archana Shah <archana.shah@wipro.com>

View File

@ -2909,8 +2909,10 @@ xmlLoadCatalog(const char *filename)
if (xmlDefaultCatalog == NULL) { if (xmlDefaultCatalog == NULL) {
catal = xmlLoadACatalog(filename); catal = xmlLoadACatalog(filename);
if (catal == NULL) if (catal == NULL) {
xmlRMutexUnlock(xmlCatalogMutex);
return(-1); return(-1);
}
xmlDefaultCatalog = catal; xmlDefaultCatalog = catal;
xmlRMutexUnlock(xmlCatalogMutex); xmlRMutexUnlock(xmlCatalogMutex);

View File

@ -196,6 +196,7 @@ xmlNewRMutex(void)
pthread_mutex_init(&tok->lock, NULL); pthread_mutex_init(&tok->lock, NULL);
tok->held = 0; tok->held = 0;
tok->waiters = 0; tok->waiters = 0;
pthread_cond_init(&tok->cv, NULL);
#elif defined HAVE_WIN32_THREADS #elif defined HAVE_WIN32_THREADS
InitializeCriticalSection(&tok->cs); InitializeCriticalSection(&tok->cs);
tok->count = 0; tok->count = 0;