Returns the caller's kernel thread ID.
#include <sys/thread.h>
tid_t thread_self ()
The thread_self subroutine returns the caller's kernel thread ID. The kernel thread ID may be useful for the bindprocessor and ptrace subroutines. The ps, trace, and vmstat commands also report kernel thread IDs, thus this subroutine can be useful for debugging multi-threaded programs.
The kernel thread ID is unrelated with the thread ID used in the threads library (libpthreads.a) and returned by the pthread_self subroutine.
The thread_self subroutine returns the caller's kernel thread ID.
This subroutine is part of the Base Operating System (BOS) Runtime.
The bindprocessor subroutine, pthread_self subroutine, ptrace subroutine.