Re: [xml] patch to libxml2-2.9.0/threads.c



  Hi Friedrich,

 this kind of problems should be discussed publicly so copying
the list,

On Wed, Sep 12, 2012 at 05:34:53PM +0200, Friedrich Haubensak wrote:


cannot compile libxml2-2.9.0 using studio 12.1 compiler on solaris 10

my quick (and dirty ?) patch below

i.m.o. structure initializer (as PTHREAD_ONCE_INIT) cannot be used in
a structure assignment anyway

  Yeah i did this as a way to reactivate thread local storage allocation
in case xmlParserCleanup() had been called (best is to really avoid that
call, but nonetheless that was a bug)


--- libxml2-2.9.0__dist/threads.c     Tue Sep 11 05:52:46 2012
+++ libxml2-2.9.0/threads.c   Wed Sep 12 16:16:18 2012
@@ -146,6 +146,7 @@
 static pthread_key_t globalkey;
 static pthread_t mainthread;
 static pthread_once_t once_control = PTHREAD_ONCE_INIT;
+static pthread_once_t once_control_init = PTHREAD_ONCE_INIT;
 static pthread_mutex_t global_init_lock = PTHREAD_MUTEX_INITIALIZER;
 #elif defined HAVE_WIN32_THREADS
 #if defined(HAVE_COMPILER_TLS)
@@ -915,7 +916,7 @@
 #ifdef HAVE_PTHREAD_H
     if ((libxml_is_threaded)  && (pthread_key_delete != NULL))
         pthread_key_delete(globalkey);
-    once_control = PTHREAD_ONCE_INIT;
+    once_control = once_control_init;
 #elif defined(HAVE_WIN32_THREADS) && !defined(HAVE_COMPILER_TLS) && (!defined(LIBXML_STATIC) || 
defined(LIBXML_STATIC_FOR_DLL))
     if (globalkey != TLS_OUT_OF_INDEXES) {
         xmlGlobalStateCleanupHelperParams *p;


  That looks fine to me, I'm temped to push this if there is no
disagreement.

Daniel

-- 
Daniel Veillard      | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
daniel veillard com  | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library  http://libvirt.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]