p*s
2 楼
使用pthread_create()出错,以下是测试用的代码:
void *ServerThread(void *arg1)
{
printf("I'm the server\n");
}
int main()
{
pthread_t serverID;
pthread_mutex_init(&lock, NULL);
printf("Now creating the thread to serve..\n");
if(pthread_create(&serverID, NULL, ServerThread, NULL)!=0)
perror("Could not create the thread\n");
pthread_join(serverID, NULL);
exit(0);
}
运行结果:
Now creating the thread to serve..
Could not create the thread
请问是为何出错?//bow
void *ServerThread(void *arg1)
{
printf("I'm the server\n");
}
int main()
{
pthread_t serverID;
pthread_mutex_init(&lock, NULL);
printf("Now creating the thread to serve..\n");
if(pthread_create(&serverID, NULL, ServerThread, NULL)!=0)
perror("Could not create the thread\n");
pthread_join(serverID, NULL);
exit(0);
}
运行结果:
Now creating the thread to serve..
Could not create the thread
请问是为何出错?//bow
c*i
3 楼
不看不是中国人
s*o
5 楼
楼主活腻了直说
相关阅读
Re: how to run background process afterEmacs数问[转载] 如何删除没用的进程双CPU的问题[转载] Pine charset Question[转载] 这里有人用过debugger xdb吗?help about installing unix based softwarHow to verify a symbolic link? thanksA werid Solaris crash when using yacc.[转载] 请教如何mask掉自己登陆的进程Veritas volume manager菜鸟2问题-about shell programmingRe: how to change my default shellSolaris system administrator help用find查找文件是如何过滤无用信息[转载] 别闲扯了, 看看这个吧, --- NFS super slowstty hupcl ixon ixoff[转载] pmap 一问[转载] 请教一个关于ln的问题what is the mean of "LL & SC"