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 楼
楼主活腻了直说
相关阅读
anyone used softbench in HP-UX???a question about using ftp dl music file 主域联不上,救命!coconut 申请 unix BZHelp please! 怎么keep当前还在运行的child processRe: 怎么在UNIX下面放CD?Who can tell me the size of /bin/login?What's defference between Saloris&SunOs?help on cxterm[转载] 请教Sun Ultra 1 上的外置SCSI硬盘怎么弄出彩色的xterm?请问显示可用打印机的命令一个奇怪的现象!装cxterm成功,特此庆祝一把[公告] Unix 板的投票结果文件的LINK到底有什么用处?how to create a group and add user to a group?[转载] Re: 请问unix下如何编写图形界面How to get the name of current executable in a library routine?Re: 请推荐一本perl book好不好