Linux获取线程ID

#include <sys/syscall.h>

#define gettid() syscall(__NR_gettid)

gettid()的返回值就是线程ID号

你可能感兴趣的:(linux,include)