This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Destroy thr->release semaphore (PR libgomp/40174)


Hi!

On targets which have non-trivial gomp_sem_destroy thr->release wasn't
properly destroyed before exiting thread.  Fixed thusly, tested
by the reporter on FreeBSD and by myself on x86_64-linux and i686-linux,
committed to trunk and 4.4 branch.

2009-05-20  Jakub Jelinek  <jakub@redhat.com>

	PR libgomp/40174
	* team.c (gomp_thread_start): Destroy thr->release semaphore.
	(gomp_free_pool_helper): Likewise.

--- libgomp/team.c.jj	2009-04-14 16:33:07.000000000 +0200
+++ libgomp/team.c	2009-05-19 09:24:33.000000000 +0200
@@ -125,6 +125,7 @@ gomp_thread_start (void *xdata)
       while (local_fn);
     }
 
+  gomp_sem_destroy (&thr->release);
   return NULL;
 }
 
@@ -201,6 +202,7 @@ gomp_free_pool_helper (void *thread_pool
   struct gomp_thread_pool *pool
     = (struct gomp_thread_pool *) thread_pool;
   gomp_barrier_wait_last (&pool->threads_dock);
+  gomp_sem_destroy (&gomp_thread ()->release);
   pthread_exit (NULL);
 }
 

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]