[PATCH 5/6] support: Add support_thread_state_wait

Florian Weimer fweimer@redhat.com
Thu Dec 18 13:45:13 GMT 2025


* Adhemerval Zanella:

> Same as support_process_state_wait, but wait for the task TID
> (obtained with gettid) from the current process.  Since the kernel
> might remove the /proc/<pid>/task/<tid>/status at any time if the
> thread terminates, the code needs to handle possible
> fopen/getline/fclose failures due to an inexistent file.

This does not guard against TID reuse.  I don't know how to accomplish
that.  The 22nd field of /proc/<pid>/task/<tid>/stat is the process
start time, not the thread creation time.

Maybe just document this in the header file as a responsibility of the
caller?

Thanks,
Florian



More information about the Libc-alpha mailing list