码迷,mamicode.com
首页 > 移动开发 > 详细

一个Android Native Thread的坑

时间:2016-07-14 19:11:00      阅读:796      评论:0      收藏:0      [点我收藏+]

标签:

在INIT_ARRAY中,起了一个线程,里面只有一个循环。结果UI线程挂死

pthread_t id_0;

pthread_create (&id_0, NULL, pipe_server, (void*)NULL);

pthread_join (id_0, NULL);

 

问题出在pthread_join上面

 

The pthread_join() function waits for the thread specified by thread to terminate. 

 

http://stackoverflow.com/questions/29724323/android-ndk-multithreading-block-ui-responds?

 

Android main thread has itself message loop. pthread_join isn‘t necessary.

Android主线程有自己的消息循环,不需要pthread_join

 

一个Android Native Thread的坑

标签:

原文地址:http://www.cnblogs.com/kiiim/p/5671371.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!