Hi, i''m having a bit of trouble with pthreads. The following code causes a segmentation fault on the line pthread_create
void* Proc(void* pParam)
{
printf("In thread...\n");
return NULL;
}
int main(int argc, char** argv)
{
pthread_t id;
printf("Starting...\n");
pthread_create(&id,NULL,Proc,NULL);
printf("Started...\n");
usleep(1000000);
return 0;
}
Output:
[steve@server test]# ./test
Starting...
Segmentation fault
[steve@server test]#
Anyone know whats causing this problem? I thought it might be that the attr variable can;t be NULL, but all the docs i''ve found say it can be NULL to use the default values, and i can''t find any useful information about initializing the structure.
Cheers,
Steve