https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98738
--- Comment #9 from Kwok Yeung <kcy at codesourcery dot com> --- I have a patch for this now. In addition to posting other semaphores in omp_fulfill_event, GOMP_taskwait also needs to be made aware of detached tasks. Also, task_running_count should not include completed tasks that are waiting for event completion, since these are not really still running, and may lead to a failure to wake up the barrier thread when required.