aboutsummaryrefslogtreecommitdiffstats
path: root/test/monniaux/thread_local/thread_local2.c
blob: ba244ac6c946eef23705781741243e41419b5317 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <pthread.h>

_Thread_local int toto;
_Thread_local int toto2 = 45;

void* poulet(void * dummy) {
  printf("%p %p\n", &toto, &toto2);
  return NULL;
}

int main() {
  pthread_t thr;
  poulet(NULL);
  pthread_create(&thr, NULL, poulet, NULL);
  pthread_join(thr, NULL);
  return 0;
}