This is OK:
pthread_create(&thread, NULL, --omited--);
This will cause segmentation fault:
pthread_create(NULL, NULL, --omited--);
I’ve checked the manual it didn’t say that the first parameter can’t be NULL,is it a bug?
I’m on OSX.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The documentation says that “[u]pon successful completion, *pthread_create*() stores the ID of the created thread in the location referenced by thread.” Storing a thread ID into a NULL location will cause a segmentation fault.