Home | History | Annotate | Download | only in bionic
      1 #include <pthread.h>
      2 #include <stdio.h>
      3 #include <unistd.h>
      4 
      5 static void *
      6 thread1_func(void* arg)
      7 {
      8     printf("Thread 1 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
      9     return 0;
     10 }
     11 
     12 static void *
     13 thread2_func(void* arg)
     14 {
     15     printf("thread 2 (arg=%d tid=%d) entered.\n", (unsigned)arg, gettid());
     16     return 1;
     17 }
     18 
     19 
     20 int main( void )
     21 {
     22     pthread_t t1, t2;
     23 
     24     pthread_create( &t1, NULL, thread1_func, (void *)1 );
     25 
     26     pthread_join(t1, NULL);
     27 
     28     printf("OK\n");
     29     return 0;
     30 }
     31