In linux c program, how to print thread id of a thread created by pthread library? for ex: we can get pid of a process by getpid()
getpid()
Platform-independent way (starting from c++11) is:
#include std::this_thread::get_id();