Skip to content

Instantly share code, notes, and snippets.

@danielhams
Created August 30, 2019 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielhams/6e41c5843ee604074c2d6e7ca61e1595 to your computer and use it in GitHub Desktop.
Save danielhams/6e41c5843ee604074c2d6e7ca61e1595 to your computer and use it in GitHub Desktop.
Using thread local storage, simple C
#include <stdio.h>
__thread int a=0;
int main(int argc, char** argv ) {
printf("a=%d\n",a);
printf("It worked!\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment