pthread_self(3THR) を使用して、呼び出しスレッドのスレッド識別子 (thread identifier) を取得します。
プロトタイプ: pthread_t pthread_self(void); #include <pthread.h> pthread_t tid; tid = pthread_self();
呼び出しスレッドのスレッド識別子 (thread identifier) が戻されます。