Question about OpenSSL id_function() and pthreads

Craig Rodrigues rodrigc at attbi.com
Wed May 28 18:10:40 PDT 2003


On Wed, May 28, 2003 at 08:46:26PM -0400, Daniel Eischen wrote:
> 
> Make an external function (in C) that converts the pthread_t
> for you and use that to convert it.

How should I do the conversion?  On FreeBSD,
pthread_t is a pointer to struct pthread.  Are there
data members in the struct pthread that I can use to
construct a unique numeric identifier?


> This is a standards question, but is there a reason why
> pthread_t can't be a pointer?  We can always change the
> thread libraries, but that would be a version bump and
> doesn't help you right now.

There was some discussion about this on freebsd-current
in February.    See the full thread here:

"OpenSSL question for id_function()"
http://docs.freebsd.org/mail/archive/2003/freebsd-current/20030302.freebsd-current.html

Mike Barcroft quoted a section of the POSIX standard which
says that pthread_t must be an arithmetic type.

Garrett Wollman indicated that changing the definition of
pthread_t to __intptr_t would be one possible solution.

-- 
Craig Rodrigues        
http://home.attbi.com/~rodrigc
rodrigc at attbi.com


More information about the freebsd-threads mailing list