Created
October 18, 2012 18:47
-
-
Save khakimov/3914044 to your computer and use it in GitHub Desktop.
posix thread
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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