Use thr_self(3C) to get the ID of the calling thread. For POSIX threads, see pthread_self Syntax.
#include <thread.h> thread_t thr_self(void);
No errors are defined.