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

Jakub Jelinek jakub@redhat.com
Wed May 20 20:57:00 GMT 2009


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



More information about the Gcc-patches mailing list