mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
check some allocation with Ashwin patch Daniel
* threads.c: check some allocation with Ashwin patch Daniel svn path=/trunk/; revision=3711
This commit is contained in:
parent
24d87d94bb
commit
14d465de48
@ -1,3 +1,7 @@
|
||||
Mon Mar 24 12:12:00 CET 2008 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* threads.c: check some allocation with Ashwin patch
|
||||
|
||||
Wed Mar 19 16:41:52 CET 2008 Daniel Veillard <daniel@veillard.com>
|
||||
|
||||
* vms/build_libxml.com: update from Tycho Hilhorst, should fix #523378
|
||||
|
11
threads.c
11
threads.c
@ -504,7 +504,9 @@ __xmlGlobalInitMutexUnlock(void)
|
||||
#ifdef HAVE_PTHREAD_H
|
||||
pthread_mutex_unlock(&global_init_lock);
|
||||
#elif defined HAVE_WIN32_THREADS
|
||||
LeaveCriticalSection(global_init_lock);
|
||||
if (global_init_lock != NULL) {
|
||||
LeaveCriticalSection(global_init_lock);
|
||||
}
|
||||
#elif defined HAVE_BEOS_THREADS
|
||||
release_sem(global_init_lock);
|
||||
#endif
|
||||
@ -657,6 +659,8 @@ xmlGetGlobalState(void)
|
||||
if ((globalval = (xmlGlobalState *)
|
||||
pthread_getspecific(globalkey)) == NULL) {
|
||||
xmlGlobalState *tsd = xmlNewGlobalState();
|
||||
if (tsd == NULL)
|
||||
return(NULL);
|
||||
|
||||
pthread_setspecific(globalkey, tsd);
|
||||
return (tsd);
|
||||
@ -720,9 +724,10 @@ xmlGetGlobalState(void)
|
||||
|
||||
xmlOnceInit();
|
||||
|
||||
if ((globalval = (xmlGlobalState *)
|
||||
tls_get(globalkey)) == NULL) {
|
||||
if ((globalval = (xmlGlobalState *) tls_get(globalkey)) == NULL) {
|
||||
xmlGlobalState *tsd = xmlNewGlobalState();
|
||||
if (tsd == NULL)
|
||||
return (NULL);
|
||||
|
||||
tls_set(globalkey, tsd);
|
||||
on_exit_thread(xmlGlobalStateCleanup, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user