Date: Fri, 30 May 2003 08:49:20 -0400 From: Craig Rodrigues <rodrigc@attbi.com> To: freebsd-threads@freebsd.org Subject: Re: Question about OpenSSL id_function() and pthreads Message-ID: <20030530124920.GA10661@attbi.com> In-Reply-To: <006b01c32585$28ca4ad0$f001a8c0@davidw2k> References: <20030528235120.GA3481@attbi.com> <006b01c32585$28ca4ad0$f001a8c0@davidw2k>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, May 30, 2003 at 02:49:13PM +0900, Alexander Nedotsukov wrote: > Hi, > > I saw you question in freebsd-threads@. > 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@attbi.com
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030530124920.GA10661>