diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-07-16 17:35:26 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-07-16 17:35:26 +0200 |
commit | 4db72361fe9c5fc148b529b6ba9af814150379d3 (patch) | |
tree | 0c0cc5fdd1c2567c317c9bba3233e37ed0b1f8d2 /libgomp | |
parent | 9a8d7941eb2e948110501a387505d657e64a1f91 (diff) | |
download | gcc-4db72361fe9c5fc148b529b6ba9af814150379d3.zip gcc-4db72361fe9c5fc148b529b6ba9af814150379d3.tar.gz gcc-4db72361fe9c5fc148b529b6ba9af814150379d3.tar.bz2 |
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
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/team.c | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 671b48b..ded506b 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2008-07-16 Jakub Jelinek <jakub@redhat.com> + + * team.c (gomp_team_end): Free team immediately if it has + just one thread. + 2008-07-08 David Edelsohn <edelsohn@gnu.org> * testsuite/libgomp.c++/c++.exp: Append multilib library path. diff --git a/libgomp/team.c b/libgomp/team.c index 18b02e7..224236c 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 { |