this repo has no description
1// CFLAGS: -lpthread
2#include <pthread.h>
3#include <stdio.h>
4#include <unistd.h>
5
6void* mythread(void*);
7
8int main()
9{
10 pthread_t th, th2;
11 void* rv;
12 pthread_create(&th, 0, mythread, 0);
13 sleep(1);
14 pthread_create(&th2, 0, mythread, 0);
15 printf("Waiting for thread...\n");
16 pthread_join(th, &rv);
17 pthread_join(th2, &rv);
18 printf("Thread joined!\n");
19 return 0;
20}
21
22void* mythread(void* p)
23{
24 sleep(2);
25}
26