マルチスレッドのプログラミング

スレッド識別子の取得

pthread_self(3THR)

pthread_self(3THR) を使用して、呼び出しスレッドのスレッド識別子 (thread identifier) を取得します。


プロトタイプ:
pthread_t	 pthread_self(void);

#include <pthread.h>

pthread_t tid;

tid = pthread_self();

戻り値

呼び出しスレッドのスレッド識別子 (thread identifier) が戻されます。