Try to use syscall to get thread ID.