NPTL vs PThread POSIX threads (pthread) is not an implementation, it is a API specification (a standard, on paper, in english) of several functions whose name starts with pthread_ and which are defined in <pthread.h> header. POSIX is also a set of s
Pthread_cleanup用于注册线程清理函数,注册的清理函数将在线程被取消或者主动调用pthread_exit时被调用: 一个简单的示例: #include <pthread.h> #include <stdio.h> // pthread_cleanup_push and pthread_cleanup_pop should be called in pairs at the same lexical nesting level // they are im