게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
pthread_create 예제인데 오류좀 잡아주시면 안될까요ㅠ
게시물ID : computer_43857짧은주소 복사하기
작성자 : 간지늅늅이
추천 : 0
조회수 : 469회
댓글수 : 3개
등록시간 : 2012/04/14 23:51:04
#include <stdio.h>
#include <pthread.h>
#include <time.h>

int cnt = 0;
void *thread_func(void *arg);
 
void main()
{
time_t start,end,total=0;
        int state = 0;
        pthread_t t_id;
int count = 0;
start = time(NULL);
 
        pthread_create(&t_id,NULL,thread_func,NULL)

while(1)
{
count++;
printf("Original_thread TID = %.2f\n",pthread_self());
end=time(NULL);
total = end - start;

if(total>10)
{
printf("Original_thread's print count = %d\n",count);
printf("Second_thread's print count = %d\n",cnt);
break;
}
}         
}
 
void *thread_func(void *arg)
{
        while(1)
{
cnt++;
printf("Second thread TID = %.2f\n", pthread_self());
}
}
 
이런데 오류가 나네요ㅠㅠ 왜날까요?? 
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호