1 // RUN: %libomp-compile && env OMP_WAIT_POLICY=active %libomp-run active
2 // RUN: %libomp-compile && env OMP_WAIT_POLICY=passive %libomp-run passive
4 // OMP_WAIT_POLICY=active should imply blocktime == INT_MAX
5 // i.e., threads spin-wait forever
6 // OMP_WAIT_POLICY=passive should imply blocktime == 0
7 // i.e., threads immediately sleep
11 #include "omp_testsuite.h"
14 fprintf(stderr
, "usage: omp_wait_policy active|passive\n");
17 int main(int argc
, char** argv
)
19 int blocktime
, retval
=1;
20 const char* env_var_value
;
27 blocktime
= kmp_get_blocktime();
29 env_var_value
= argv
[1];
30 if (!strcmp(env_var_value
, "active")) {
31 retval
= (blocktime
!= INT_MAX
);
32 } else if (!strcmp(env_var_value
, "passive")) {
33 retval
= (blocktime
!= 0);