x. 获取线程自身的ID pthread_self - obtain ID of the calling thread
#include <pthread.h>
pthread_t pthread_self(void);
// This function always succeeds, returning the calling thread's ID.
x. 判断两个线程ID是否相同 pthread_equal - compare thread IDs
#include <pthread.h>
int pthread_equal(pthread_t t1, pthread_t t2);
// This function always succeeds. returning nonzero or zero .
x. 获取内核表示的线程ID gettid - get thread identification
#include <sys/types.h>
pid_t gettid(void);
// This call is always succeeds., returning the thread ID of the calling process , not the same thing as a POSIX thread ID