summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/test
diff options
context:
space:
mode:
authorJoachim Protze <protze@itc.rwth-aachen.de>2018-07-05 09:14:01 +0000
committerJoachim Protze <protze@itc.rwth-aachen.de>2018-07-05 09:14:01 +0000
commit00505b85a3fb6f6e4b095ebb6b753e7a376a7d3e (patch)
tree1845408fa65132b783f32abc6eacc54c14422471 /openmp/runtime/test
parent466037900c34e2d2727e8688088f8d2b9eef81bd (diff)
downloadbcm5719-llvm-00505b85a3fb6f6e4b095ebb6b753e7a376a7d3e.tar.gz
bcm5719-llvm-00505b85a3fb6f6e4b095ebb6b753e7a376a7d3e.zip
[OMPT] Add synchronization to threads_nested.c testcase
The testcase potentially fails when a thread is reused. The added synchronization makes sure this does not happen. Patch provided by Simon Convent Differential Revision: https://reviews.llvm.org/D48932 llvm-svn: 336326
Diffstat (limited to 'openmp/runtime/test')
-rw-r--r--openmp/runtime/test/ompt/misc/threads_nested.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/openmp/runtime/test/ompt/misc/threads_nested.c b/openmp/runtime/test/ompt/misc/threads_nested.c
index 4e2a8d2253f..0d38dcf882d 100644
--- a/openmp/runtime/test/ompt/misc/threads_nested.c
+++ b/openmp/runtime/test/ompt/misc/threads_nested.c
@@ -4,14 +4,16 @@
#include <omp.h>
int main() {
+
+ int condition = 0;
int x = 0;
omp_set_nested(1);
#pragma omp parallel num_threads(2)
{
#pragma omp parallel num_threads(2)
{
-#pragma omp atomic
- x++;
+ OMPT_SIGNAL(condition);
+ OMPT_WAIT(condition, 4);
}
}
OpenPOWER on IntegriCloud