aboutsummaryrefslogtreecommitdiff
path: root/libgomp/task.c
diff options
context:
space:
mode:
authorKwok Cheung Yeung <kcy@codesourcery.com>2021-05-14 09:59:11 -0700
committerKwok Cheung Yeung <kcy@codesourcery.com>2021-05-17 13:15:08 -0700
commitba886d0c488ebea2eb2df95c2069a3e207704dac (patch)
treec9977390cd9f7894ebc1837bbce68272f951d934 /libgomp/task.c
parent5d93261bc03c9c6891ccd8c77ab22b2a09971905 (diff)
downloadgcc-ba886d0c488ebea2eb2df95c2069a3e207704dac.zip
gcc-ba886d0c488ebea2eb2df95c2069a3e207704dac.tar.gz
gcc-ba886d0c488ebea2eb2df95c2069a3e207704dac.tar.bz2
openmp: Notify team barrier of pending tasks in omp_fulfill_event
The team barrier should be notified of any new tasks that become runnable as the result of a completing task, otherwise the barrier threads might not resume processing available tasks, resulting in a hang. 2021-05-17 Kwok Cheung Yeung <kcy@codesourcery.com> libgomp/ * task.c (omp_fulfill_event): Call gomp_team_barrier_set_task_pending if new tasks generated. * testsuite/libgomp.c-c++-common/task-detach-13.c: New.
Diffstat (limited to 'libgomp/task.c')
-rw-r--r--libgomp/task.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libgomp/task.c b/libgomp/task.c
index 1c73c75..feb4796 100644
--- a/libgomp/task.c
+++ b/libgomp/task.c
@@ -2460,6 +2460,7 @@ omp_fulfill_event (omp_event_handle_t event)
if (new_tasks > 0)
{
/* Wake up threads to run new tasks. */
+ gomp_team_barrier_set_task_pending (&team->barrier);
do_wake = team->nthreads - team->task_running_count;
if (do_wake > new_tasks)
do_wake = new_tasks;