I can inject the android system process "zygote", and I can execute my code in it. It is all fine util I do this:
pthread_t id;
int ret = pthread_create(&id, 0, thread_main, 0);
static void* thread_main(void* param){
int count = 0;
while (count < 10)
{
count += 1;
usleep(1000 * 1000);
printf("wait in loop %d.", count);
}
return 0;
}
Then, startup of any app on my phone is blocked when the loop is running. It is so strange for an c++ developer! It is running in a thread, but it blocks others!
Aucun commentaire:
Enregistrer un commentaire