1 // RUN: %libomp-compile-and-run
2 // RUN: env KMP_LOCK_KIND=tas KMP_SPIN_BACKOFF_PARAMS=2048,200 %libomp-run
3 // RUN: env KMP_LOCK_KIND=futex %libomp-run
5 #include "omp_testsuite.h"
11 int nr_threads_in_single
= 0;
13 int nr_iterations
= 0;
17 #pragma omp parallel shared(lck)
20 for(i
= 0; i
< LOOPCOUNT
; i
++) {
23 nr_threads_in_single
++;
26 nr_threads_in_single
--;
27 result
= result
+ nr_threads_in_single
;
31 omp_destroy_lock(&lck
);
33 return ((result
== 0) && (nr_iterations
== LOOPCOUNT
));
41 for(i
= 0; i
< REPETITIONS
; i
++) {
42 if(!test_omp_lock()) {