Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 3 Jun 2010 10:51:43 -0400 (EDT)
From:      Daniel Eischen <deischen@freebsd.org>
To:        =?UTF-8?Q?V=C3=A1clav_Haisman?= <v.haisman@sh.cvut.cz>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: How to get a thread ID?
Message-ID:  <Pine.GSO.4.64.1006031045330.28157@sea.ntplx.net>
In-Reply-To: <6e716c850fa84621482b71826dae55d5@shell.sh.cvut.cz>
References:  <6e716c850fa84621482b71826dae55d5@shell.sh.cvut.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
  This message is in MIME format.  The first part should be readable text,
  while the remaining parts are likely unreadable without MIME-aware tools.

---559023410-851401618-1275576703=:28157
Content-Type: TEXT/PLAIN; charset=utf-8; format=flowed
Content-Transfer-Encoding: QUOTED-PRINTABLE

On Thu, 3 Jun 2010, V=C3=A1clav Haisman wrote:

>
> Hi,
> is it possible to obtain some sort of a thread ID that identifies a threa=
d
> within a process other than pthread_self()? Something like gettid() on
> Linux? Apparently, on FreeBSD the pthread_t is a pointer type and does no=
t
> identify the thread well enough. GDB on FreeBSD seems to know about threa=
ds
> and does not seem to use the same ID as is pthread_t.

"identifies a thread" well enough for what?  pthread_t is suppose
to be opaque.  Whether it is an int, pointer, or whatever, it is
implementation-defined and not suppose provide any more information
than available through the standard pthread interfaces.  There are
some non-portable interfaces in <pthread_np.h> though.

--=20
DE
---559023410-851401618-1275576703=:28157--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.1006031045330.28157>