Skip to content

Instantly share code, notes, and snippets.

@khakimov
Created October 18, 2012 18:47
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 khakimov/3914044 to your computer and use it in GitHub Desktop.
Save khakimov/3914044 to your computer and use it in GitHub Desktop.
posix thread
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
void *thread(void *arg);
int main()
{
pthread_t tid;
pthread_create(&tid, NULL, thread, NULL);
pthread_join(tid, NULL);
exit(0);
}
void *thread(void *arg)
{
printf("Hello world\n");
return NULL;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment