[llvm] Stop including unordered_map (NFC)
[llvm-project.git] / openmp / runtime / test / ompt / ompt-signal.h
blobb5c28cf5dee0fdc4781476bf0c1801b385ac8ae4
1 #if defined(WIN32) || defined(_WIN32)
2 #include <windows.h>
3 #define delay() Sleep(1);
4 #else
5 #include <unistd.h>
6 #define delay(t) usleep(t);
7 #endif
9 // These functions are used to provide a signal-wait mechanism to enforce expected scheduling for the test cases.
10 // Conditional variable (s) needs to be shared! Initialize to 0
12 #define OMPT_SIGNAL(s) ompt_signal(&s)
13 //inline
14 void ompt_signal(int* s)
16 #pragma omp atomic
17 (*s)++;
20 #define OMPT_WAIT(s,v) ompt_wait(&s,v)
21 // wait for s >= v
22 //inline
23 void ompt_wait(int *s, int v)
25 int wait=0;
26 do{
27 delay(10);
28 #pragma omp atomic read
29 wait = (*s);
30 }while(wait<v);