Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
edcab030ca14a54060baa83fde206cc0eabbd3f3
[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
18   thread_specific_variable++;
19   printf("%d\n", thread_specific_variable);
20   return 0;
21 }