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

スレッド識別子の取得

pthread_self(3T)

pthread_self() は、呼び出しスレッドの識別子を取得します。

プロトタイプ:
pthread_t	 pthread_self(void);
#include <pthread.h>

pthread_t tid;

tid = pthread_self();

戻り値

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