pthread_create에서 SEGV가 나는 이유는 뭘까요?

Seven..의 이미지

잘돌아가던 프로그래을 조금 수정하기위해 백업본을 만들고..
수정을 했더니 이게갑자기
pthread_create에서 세그멘테이션을날리면서 죽네요..

#define MAX_PHIL 5;

int main(int argc, char* argv[]) {
...
	pthread_t a_thread[MAX_PHIL];
	
	if(!CreateThread(a_thread))
		g_check=false;
...}

bool CreateThread(pthread_t *th)
{
	int res;
	for(int i=0; i<MAX_PHIL; i++)
	{	
		res = pthread_create(&th[i], NULL, thread_function, NULL);
		if(res !=0)
		{
			fprintf(stderr, "%d thread creation failed\n", i);
			return false;
		}
	}
	return true;
}

그전에도 잘돌아갔었고.. 해서 함수 사용에 위험한부분이있는지 여쭤봅니다.

첫번째 스레드가 휙 돌아가고
잠시 sleep이 걸리면
두번ㅉ 스레드를 생성하려고 시도하다가
res= pthread_create이줄에서 에러가 납니다.
왜 이러는지 혹은 pthread_create에서 세그멘테이션이 뜨는 이유는뭘까요?[/code]

mach의 이미지

thread_function()
{
    while(1)    // 추가
       pause();// 추가
    ....
   기존코드;
}

이렇게 수정하고 수행해보십시요.
의심되는 부분은 thread_function()의 내부 어느 부분이 아닌가? 합니다.

------------------ P.S. --------------
지식은 오픈해서 검증받아야 산지식이된다고 동네 아저씨가 그러더라.