c语言中判断某个线程是否结束?

首先定义了pthread_t thread[2] 线程数组,而且已经赋过值了;

下面这段是什么意思?这样可以判断thread[1] !=0 线程是否结束吗?

if(thread[1] !=0) { pthread_join(thread[1],NULL); printf("线程2已经结束\n"); }