最近一段时间忙 状态不好。
写blog也没有时间。
今天看到pthread的错误用法
void * thread_callback( void * )
{
return 0;
}
int main()
{
int i;
for( i =0; i < 200; ++i )
{
pthread_create();
}
}
在设备上可以崩溃。
需要在pthread_create之后加入
pthread_join( tid );
或者
pthread_detach( tid );
如果在
void * thread_callback( void * )
中加入
pthread_detach( pthread_self );
程序仍旧崩溃。
设备上是uclibc
5810

被折叠的 条评论
为什么被折叠?



