[AMDGPU] Add True16 register classes.
[llvm-project.git] / lldb / test / API / lang / c / tls_globals / main.c
blobbdfd78c1ac34bb0304616ee7ea8a55c63b392688
1 #include <stdio.h>
2 #include <pthread.h>
3 #include <unistd.h>
5 void shared_check();
6 // On some OS's (darwin) you must actually access a thread local variable
7 // before you can read it
8 int
9 touch_shared();
11 // Create some TLS storage within the static executable.
12 __thread int var_static = 44;
14 void *fn_static(void *param)
16 var_static *= 2;
17 shared_check();
18 usleep(1); // thread breakpoint
19 for(;;)
20 usleep(1);
23 int main (int argc, char const *argv[])
25 pthread_t handle;
26 pthread_create(&handle, NULL, &fn_static, NULL);
27 touch_shared();
28 for (; var_static;)
30 usleep(1); // main breakpoint
33 return 0;