Skip to content

Commit 00505b8

Browse files
committedJul 5, 2018
[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
1 parent 4660379 commit 00505b8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎openmp/runtime/test/ompt/misc/threads_nested.c

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
#include <omp.h>
55

66
int main() {
7+
8+
int condition = 0;
79
int x = 0;
810
omp_set_nested(1);
911
#pragma omp parallel num_threads(2)
1012
{
1113
#pragma omp parallel num_threads(2)
1214
{
13-
#pragma omp atomic
14-
x++;
15+
OMPT_SIGNAL(condition);
16+
OMPT_WAIT(condition, 4);
1517
}
1618
}
1719

0 commit comments

Comments
 (0)
Please sign in to comment.