This commit is contained in:
Tien
2019-11-17 15:06:20 +07:00
parent 2ffb7a19a4
commit d753ae2fdc
54 changed files with 899 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
#include <stdio.h>
#include <pthread.h>
void *hello(void *tid)
{
printf("Hello from thread %ld\n", (long)tid);
}
int main()
{
pthread_t tid[10];
long i;
for (i = 0; i < 10; i++)
{
pthread_create(&tid[i], NULL, hello, (void *)i);
pthread_join(tid[i], NULL);
}
pthread_exit(NULL);
}