From owner-freebsd-threads@FreeBSD.ORG Fri May 30 05:49:13 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EF51137B401 for ; Fri, 30 May 2003 05:49:12 -0700 (PDT) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [24.61.43.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id CB20D43F75 for ; Fri, 30 May 2003 05:49:11 -0700 (PDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: from h00609772adf0.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1])h4UCnLSr010672 for ; Fri, 30 May 2003 08:49:22 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)h4UCnKoE010671 for freebsd-threads@freebsd.org; Fri, 30 May 2003 08:49:21 -0400 (EDT) Date: Fri, 30 May 2003 08:49:20 -0400 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20030530124920.GA10661@attbi.com> References: <20030528235120.GA3481@attbi.com> <006b01c32585$28ca4ad0$f001a8c0@davidw2k> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <006b01c32585$28ca4ad0$f001a8c0@davidw2k> User-Agent: Mutt/1.4i Subject: Re: Question about OpenSSL id_function() and pthreads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 May 2003 12:49:13 -0000 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(GetCurrentThreadId()); > #else > return reinterpret_cast(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