summaryrefslogtreecommitdiff
path: root/tests/bionic/libc/bionic/test_pthread_create.c
blob: 66139c9f2d44a0980bdf7d869b0e94ca9f8f58f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <pthread.h>
#include <stdio.h>
#include <unistd.h>

static void *
thread1_func(void* arg)
{
    printf("Thread 1 (arg=%p tid=%d) entered.\n", arg, gettid());
    return 0;
}

static void *
thread2_func(void* arg)
{
    printf("thread 2 (arg=%p tid=%d) entered.\n", arg, gettid());
    return 1;
}


int main( void )
{
    pthread_t t1, t2;

    pthread_create( &t1, NULL, thread1_func, (void *)1 );

    pthread_join(t1, NULL);

    printf("OK\n");
    return 0;
}