Skip to content

Instantly share code, notes, and snippets.

@eddarmitage
Created January 26, 2012 16:27
Show Gist options
  • Save eddarmitage/1683628 to your computer and use it in GitHub Desktop.
Save eddarmitage/1683628 to your computer and use it in GitHub Desktop.
PThreads Typo???
void hello(int *n)
{
printf("hello %d\n",*n);
}
int main(void)
{
int m;
pthread_t thr1, thr2;
m = 1;
pthread_create(&thr1, NULL, (void*(*)(void*))hello, &m);
m = 2;
pthread_create(&thr1, NULL, (void*(*)(void*))hello, &m);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment