I was playing with std::thread and I was wondering how is it possible to get the thread id of a new std::thread(), I am not talking about std::t
std::thread
std::thread()
std::t
How about this:
pid_t gettid (void) { return syscall(__NR_gettid); }
http://yusufonlinux.blogspot.com/2010/11/get-thread-id-from-linux.html
Looks like __NR_gettid is defined in unistd.h