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

static void *thread_func(void *arg)
{
	char buffer[10];

	while(1)
	{
		printf("thread_func\n");
		sleep(1);
	}
	pthread_exit(0);
}

int demo_main(void)
{
	pthread_attr_t attr;
	pthread_t tid;
	int s;

	s = pthread_attr_init(&attr);
	if (s != 0)
	{
		perror("pthread_attr_init error\n");
		exit(-1);
	}

	
	s = pthread_create(&tid, &attr, thread_func, NULL);
	if (s != 0)
	{
		perror("pthread_create error\n");
		exit(-2);
	}

	s = pthread_join(tid, NULL);
	if (s != 0)
	{
		perror("pthread_join error\n");
		exit(-3);
	}

	return 0;
}
