aboutsummaryrefslogtreecommitdiffstats
path: root/tests/threads.c
blob: 18b0145825b4870883d17abb637ce0a52d48fd21 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <pthread.h>
#include <unistd.h>

static int x;

static void *
thread_main(void *data)
{
	sleep(1);
	return data;
}

int
main(void)
{
	pthread_t thread;
	if (pthread_create(&thread, NULL, thread_main, &x))
		return 2;
	sleep(2);
	return 1;
}