Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / tools / cmake / test_prog / prog_thread_storage.c
1 /* Copyright (c) 2010-2011, 2013-2014. The SimGrid Team.
2  * All rights reserved.                                                     */
3
4 /* This program is free software; you can redistribute it and/or modify it
5  * under the terms of the license (GNU LGPL) which comes with this package. */
6
7 #include <stdio.h>
8
9 #ifdef _MSC_VER
10 __declspec(thread)
11 #else
12 __thread 
13 #endif
14 int thread_specific_variable = 0;
15
16 int main(void) {
17   thread_specific_variable++;
18   printf("%d\n", thread_specific_variable);
19   return 0;
20 }