libxml2 r3810 - trunk



Author: veillard
Date: Sun Jan 18 15:41:30 2009
New Revision: 3810
URL: http://svn.gnome.org/viewvc/libxml2?rev=3810&view=rev

Log:
* threads.c: also remove pthread key when stopping thread
  support, patch based on Alex Ott one should fix #564723
daniel


Modified:
   trunk/ChangeLog
   trunk/threads.c

Modified: trunk/threads.c
==============================================================================
--- trunk/threads.c	(original)
+++ trunk/threads.c	Sun Jan 18 15:41:30 2009
@@ -63,6 +63,8 @@
 extern int pthread_key_create (pthread_key_t *__key,
                                void (*__destr_function) (void *))
 	   __attribute((weak));
+extern int pthread_key_delete (pthread_key_t __key)
+	   __attribute((weak));
 extern int pthread_mutex_init ()
 	   __attribute((weak));
 extern int pthread_mutex_destroy ()
@@ -83,6 +85,8 @@
 	   __attribute((weak));
 extern int pthread_key_create ()
 	   __attribute((weak));
+extern int pthread_key_delete ()
+	   __attribute((weak));
 extern int pthread_cond_signal ()
 	   __attribute((weak));
 #endif
@@ -860,6 +864,7 @@
             (pthread_getspecific != NULL) &&
             (pthread_setspecific != NULL) &&
             (pthread_key_create != NULL) &&
+            (pthread_key_delete != NULL) &&
             (pthread_mutex_init != NULL) &&
             (pthread_mutex_destroy != NULL) &&
             (pthread_mutex_lock != NULL) &&
@@ -913,6 +918,9 @@
         globalkey = TLS_OUT_OF_INDEXES;
     }
     DeleteCriticalSection(&cleanup_helpers_cs);
+#elif defined HAVE_PTHREAD_H
+    if ((pthread_key_delete != NULL) && (globalkey != NULL))
+        pthread_key_delete(globalkey);
 #endif
 }
 



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