diff options
author | Alan Modra <amodra@gmail.com> | 2011-12-09 12:51:43 +1030 |
---|---|---|
committer | Alan Modra <amodra@gcc.gnu.org> | 2011-12-09 12:51:43 +1030 |
commit | fbf7be801c91a75bfae7b43cd169620743ba1f52 (patch) | |
tree | 34b694493aa13f6544581b57928cb2b0a952d54a /libgomp | |
parent | 108ba412c4c375613a49bd02508fe1e776037576 (diff) | |
download | gcc-fbf7be801c91a75bfae7b43cd169620743ba1f52.tar.gz |
re PR libgomp/51376 (libgomp taskwait failure)
PR libgomp/51376
* task.c (GOMP_taskwait): Don't access task->children outside of
task_lock mutex region.
(GOMP_task): Likewise.
From-SVN: r182151
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 7 | ||||
-rw-r--r-- | libgomp/task.c | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index cf3f0043026..6af961d93b0 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,10 @@ +2011-12-09 Alan Modra <amodra@gmail.com> + + PR libgomp/51376 + * task.c (GOMP_taskwait): Don't access task->children outside of + task_lock mutex region. + (GOMP_task): Likewise. + 2011-12-06 Jakub Jelinek <jakub@redhat.com> PR libgomp/51132 diff --git a/libgomp/task.c b/libgomp/task.c index d3d72663f35..4b75850072b 100644 --- a/libgomp/task.c +++ b/libgomp/task.c @@ -116,10 +116,11 @@ GOMP_task (void (*fn) (void *), void *data, void (*cpyfn) (void *, void *), } else fn (data); - if (task.children) + if (team != NULL) { gomp_mutex_lock (&team->task_lock); - gomp_clear_parent (task.children); + if (task.children != NULL) + gomp_clear_parent (task.children); gomp_mutex_unlock (&team->task_lock); } gomp_end_task (); @@ -290,8 +291,9 @@ GOMP_taskwait (void) struct gomp_task *child_task = NULL; struct gomp_task *to_free = NULL; - if (task == NULL || task->children == NULL) + if (task == NULL || team == NULL) return; + gomp_mutex_lock (&team->task_lock); while (1) { |