The new thread terminates in one of the following ways

以下内容翻译的是:

 

http://man7.org/linux/man-pages/man3/pthread_create.3.html

 

The new thread terminates in one of the following ways: * It calls pthread_exit(3), specifying an exit status value that is available to another thread in the same process that calls pthread_join(3). * It returns from start_routine(). This is equivalent to calling pthread_exit(3) with the value supplied in the return statement. * It is canceled (see pthread_cancel(3)). * Any of the threads in the process calls exit(3), or the main thread performs a return from main(). This causes the termination of all threads in the process. 片段。 线程中断有以下几种方式: 线程中调用thread exit函数,该函数调用需要指定一个退出状态,如果有其他线程 thread join这个线程的话,这个状态值有用。 线程函数返回。这种方式等同于thread exit,exit的状态值等同于返回值。 调用thread cancel, 请求取消了这个线程。 在程序中任何地方、任何线程中调用了exit方法退出,包括在主线程main方法返回都将 中断所有线程。

你可能感兴趣的:(thread)