]> gcc.gnu.org Git - gcc.git/commitdiff
re PR libgomp/51376 (libgomp taskwait failure)
authorAlan Modra <amodra@gmail.com>
Fri, 9 Dec 2011 02:21:43 +0000 (12:51 +1030)
committerAlan Modra <amodra@gcc.gnu.org>
Fri, 9 Dec 2011 02:21:43 +0000 (12:51 +1030)
PR libgomp/51376
* task.c (GOMP_taskwait): Don't access task->children outside of
task_lock mutex region.
(GOMP_task): Likewise.

From-SVN: r182151

libgomp/ChangeLog
libgomp/task.c

index cf3f0043026dfc6df238de9a4a0a82c22dd0084a..6af961d93b0f78bbd54918bf8b3fb65f1cb2195a 100644 (file)
@@ -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
index d3d72663f35c0762a2f4c0557240350eb08c9dd5..4b75850072bb450ff6f55ff16e1dd51c20d000e4 100644 (file)
@@ -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)
     {
This page took 0.066704 seconds and 5 git commands to generate.