File: pthread02.c

package info (click to toggle)
criu 4.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 11,500 kB
  • sloc: ansic: 139,280; python: 7,484; sh: 3,824; java: 2,799; makefile: 2,659; asm: 1,137; perl: 206; xml: 117; exp: 45
file content (41 lines) | stat: -rw-r--r-- 608 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
/*
 * A simple testee program with threads
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <pthread.h>

#include "zdtmtst.h"

const char *test_doc = "Create a thread with a dead leader\n";
const char *test_author = "Andrew Vagin <avagin@openvz.org";

static void *thread_func(void *args)
{
	test_waitsig();
	pass();
	exit(0);
}

int main(int argc, char *argv[])
{
	pthread_t th1;
	int ret;

	test_init(argc, argv);

	ret = pthread_create(&th1, NULL, &thread_func, NULL);

	if (ret) {
		fail("Can't pthread_create");
		exit(1);
	}

	test_daemon();

	pthread_exit(NULL);
	return 0;
}