small cleanup to avoid packaging .svn applied patch to avoid a problem in
* Makefile.am: small cleanup to avoid packaging .svn
* libxml.h threads.c parser.c: applied patch to avoid a problem
in concurrent threaded initialization fix from Ted Phelps
Daniel
svn path=/trunk/; revision=3582
diff --git a/parser.c b/parser.c
index 7c12fd8..b405164 100644
--- a/parser.c
+++ b/parser.c
@@ -12845,26 +12845,34 @@
if (xmlParserInitialized != 0)
return;
- if ((xmlGenericError == xmlGenericErrorDefaultFunc) ||
- (xmlGenericError == NULL))
- initGenericErrorDefaultFunc(NULL);
- xmlInitGlobals();
- xmlInitThreads();
- xmlInitMemory();
- xmlInitCharEncodingHandlers();
- xmlDefaultSAXHandlerInit();
- xmlRegisterDefaultInputCallbacks();
+#ifdef LIBXML_THREAD_ENABLED
+ __xmlGlobalInitMutexLock();
+ if (xmlParserInitialized == 0) {
+#endif
+ if ((xmlGenericError == xmlGenericErrorDefaultFunc) ||
+ (xmlGenericError == NULL))
+ initGenericErrorDefaultFunc(NULL);
+ xmlInitGlobals();
+ xmlInitThreads();
+ xmlInitMemory();
+ xmlInitCharEncodingHandlers();
+ xmlDefaultSAXHandlerInit();
+ xmlRegisterDefaultInputCallbacks();
#ifdef LIBXML_OUTPUT_ENABLED
- xmlRegisterDefaultOutputCallbacks();
+ xmlRegisterDefaultOutputCallbacks();
#endif /* LIBXML_OUTPUT_ENABLED */
#ifdef LIBXML_HTML_ENABLED
- htmlInitAutoClose();
- htmlDefaultSAXHandlerInit();
+ htmlInitAutoClose();
+ htmlDefaultSAXHandlerInit();
#endif
#ifdef LIBXML_XPATH_ENABLED
- xmlXPathInit();
+ xmlXPathInit();
#endif
- xmlParserInitialized = 1;
+ xmlParserInitialized = 1;
+#ifdef LIBXML_THREAD_ENABLED
+ }
+ __xmlGlobalInitMutexUnlock();
+#endif
}
/**