- 论坛徽章:
- 0
|
本帖最后由 hedong0411 于 2013-03-13 09:32 编辑
开发一个模块,使用下载的源码,已经将代码移植成功,功能正常实现(源码没有问题的)。但是最近升级了设备的SDK,编译链也升级了,升级后我的功能不好用了。
代码如下:
static void *WorkerThread( void *arg ) {
。。。。。。。。。。。。
printf("file :%s function:%s line:%d \n",__FILE__,__FUNCTION__,__LINE__); //运行到这来并打印出来了
pthread_mutex_lock( &tp->mutex );
printf("file :%s function:%s line:%d \n",__FILE__,__FUNCTION__,__LINE__); //这来没有打印出来
tp->totalThreads++;
pthread_cond_broadcast( &tp->start_and_shutdown );
printf("file :%s function:%s line:%d \n",__FILE__,__FUNCTION__,__LINE__);
pthread_mutex_unlock( &tp->mutex );
。。。。。。。。。
}
static void *CreateThread( void *arg ) { //命令行调用该函数
。。。。。。。。。
printf("file :%s function:%s line:%d \n",__FILE__,__FUNCTION__,__LINE__); //这个打印出来了
rc = pthread_create( &temp, NULL, WorkerThread, tp );printf("file :%s function:%s line:%d \n",__FILE__,__FUNCTION__,__LINE__); //这个没有打印出来了,并且命令行挂死了不动,查看ps时发现多了两个线程
。。。。。。。。。。。
}
已经查看过,我的模块已经用新的编译链编译过,且新的lib库libpthread 没有问题(因为我编写过一个pthread_create函数,放到设备中,能够正常执行)。
请各位大侠指点一下,到底是哪里出现问题了。 |
|