libthread_db thread handles
Roland McGrath
roland@redhat.com
Tue Jan 14 23:01:00 GMT 2003
> td_thrhandle_t is opaque; it is documented as opaque in <thread_db.h>.
> I don't want to look at th_unique. Can I rely on the fact that the contents
> of a td_thrhandle_t are stable and can be re-used if I save the
> td_thrhandle_t?
For the life of the td_thragent_t, yes. That is, until there is a TD_DEATH
event for the thread. Once you resume the LWP that stopped to report the
TD_DEATH event, any td_thrandle_t associated with the dying thread is
invalid (as you would expect). Since the closest thing to a spec for
thread_db is the Solaris documentation, and that's vague, we can't quite
say that this is "part of the spec". But in extant GNU/Linux
implementations it is certainly true, and I can't envision an
implementation in which it would not be true.
More information about the Gdb
mailing list