是否有可能检查线程是否仍在运行?使用 join 并不是我真正需要的,因为我想要一个有点像这样的设置:
pthread_t thread_id;
while(true){
do_stuff();
if(!thread_id || is_finished(thread_id){
pthread_create(&thread_id, NULL, do_stuff_with_the_above_stuff, NULL);
}
//Else continue to do_stuff() for another round
}