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

[xml] Some more fixes for threads.c



Hi,

Have attached some more fixes in threads.c

Regards

Ashwin

 

*** threads.c	2008-03-24 14:26:10.000000000 +0530
--- threadsfix.c	2008-03-24 14:29:42.000000000 +0530
*************** __xmlGlobalInitMutexUnlock(void)
*** 504,510 ****
  #ifdef HAVE_PTHREAD_H
      pthread_mutex_unlock(&global_init_lock);
  #elif defined HAVE_WIN32_THREADS
!     LeaveCriticalSection(global_init_lock);
  #elif defined HAVE_BEOS_THREADS
      release_sem(global_init_lock);
  #endif
--- 504,513 ----
  #ifdef HAVE_PTHREAD_H
      pthread_mutex_unlock(&global_init_lock);
  #elif defined HAVE_WIN32_THREADS
! 	if (global_init_lock != NULL)
! 	{
! 		LeaveCriticalSection(global_init_lock);
! 	}
  #elif defined HAVE_BEOS_THREADS
      release_sem(global_init_lock);
  #endif
*************** xmlGetGlobalState(void)
*** 657,662 ****
--- 660,667 ----
      if ((globalval = (xmlGlobalState *)
           pthread_getspecific(globalkey)) == NULL) {
          xmlGlobalState *tsd = xmlNewGlobalState();
+         if (tsd == NULL)
+             return NULL;
  
          pthread_setspecific(globalkey, tsd);
          return (tsd);
*************** xmlGetGlobalState(void)
*** 723,728 ****
--- 728,735 ----
      if ((globalval = (xmlGlobalState *)
           tls_get(globalkey)) == NULL) {
          xmlGlobalState *tsd = xmlNewGlobalState();
+         if (tsd == NULL)
+          return NULL;
  
          tls_set(globalkey, tsd);
          on_exit_thread(xmlGlobalStateCleanup, NULL);


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