Thomas Stuefe writes:
On Linux, pthread id is set in the parent thread, after pthread_create returns. Only the kernel thread id is set by the child (I find this duality confusing). thread_cpu_time uses pthread_id. So, on Linux, it may or may not be set before the thread stack boundaries are initialized, depending on whether the native entry function ran before the parent thread continued.
So it is still possible to see a zero pthread_t for the new thread..