pthread_self Subroutine Purpose Returns the calling thread's ID. Library Threads Library (libpthreads.a) Syntax #include pthread_t pthread_self () Description The pthread_self subroutine returns the calling thread's ID. Note: The pthread.h header file must be the first included file of each source file using the threads library. Return Values The calling thread's ID is returned. Implementation Specifics This subroutine is part of the Base Operating System (BOS) Runtime. Related Information The pthread_create subroutine, pthread_equal subroutine. Creating Threads. Threads Library Quick Reference.