From 4db72361fe9c5fc148b529b6ba9af814150379d3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Wed, 16 Jul 2008 17:35:26 +0200 Subject: [PATCH] team.c (gomp_team_end): Free team immediately if it has just one thread. * team.c (gomp_team_end): Free team immediately if it has just one thread. From-SVN: r137886 --- libgomp/ChangeLog | 5 +++++ libgomp/team.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 671b48bde76..ded506b0636 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2008-07-16 Jakub Jelinek + + * team.c (gomp_team_end): Free team immediately if it has + just one thread. + 2008-07-08 David Edelsohn * testsuite/libgomp.c++/c++.exp: Append multilib library path. diff --git a/libgomp/team.c b/libgomp/team.c index 18b02e72f90..224236c6604 100644 --- a/libgomp/team.c +++ b/libgomp/team.c @@ -498,7 +498,8 @@ gomp_team_end (void) gomp_mutex_destroy (&team->work_share_list_free_lock); #endif - if (__builtin_expect (thr->ts.team != NULL, 0)) + if (__builtin_expect (thr->ts.team != NULL, 0) + || __builtin_expect (team->nthreads == 1, 0)) free_team (team); else { -- 2.30.2