呼び出しスレッドの ID を取得するには、thr_self(3C) を使用します。POSIX スレッドの場合については、「pthread_self の構文」を参照してください。
#include <thread.h> thread_t thr_self(void);
エラーが未定義です。