Question about OpenSSL id_function() and pthreads
Craig Rodrigues
rodrigc at attbi.com
Fri May 30 05:49:13 PDT 2003
On Fri, May 30, 2003 at 02:49:13PM +0900, Alexander Nedotsukov wrote:
> Hi,
>
> I saw you question in freebsd-threads at .
> Just if you still looking for a right answer (in C++ terms of course)
> here it is.
>
> static unsigned long
> idFunction()
> {
> #ifdef _WIN32
> return static_cast<unsigned long>(GetCurrentThreadId());
> #else
> return reinterpret_cast<unsigned long>(pthread_self());
> #endif
> }
Thanks for this advice. Your advice is the same given to me
by the authors of the software that I am porting to FreeBSD:
http://www.zeroc.com/vbulletin/showthread.php?threadid=122&goto=newpost
The authors of that software didn't like the idea of unconditionally
using a C-style cast for the results of pthread_self().
--
Craig Rodrigues
http://home.attbi.com/~rodrigc
rodrigc at attbi.com
More information about the freebsd-threads
mailing list