单选题
有如下C语言程序
void * th_f(void * arg)
{
printf('Hello World');
pthrcad_exit(0);
}
int main(volel)
{
pthread_t tid;
int st;
st=pthrcad_create(&tid, NULL, th_f, NULL);
if(st==0)
printf('Oops, I can not createthread\n');
exit(NULL);
}
针对上述程序,下列叙述中哪一个是正确的?______
【正确答案】
A
【答案解析】pthread_create(&tid, NULL, th_f, NULL)创建线程后,运行该线程。th_f线程中调用了pthread_exit(0),线程th_f运行后主动退出。故本题答案选择A选项。