From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18570 invoked by alias); 26 May 2007 13:10:42 -0000 Received: (qmail 18562 invoked by uid 22791); 26 May 2007 13:10:42 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Sat, 26 May 2007 13:10:40 +0000 Received: (qmail invoked by alias); 26 May 2007 13:10:37 -0000 Received: from p54B33C4C.dip0.t-ipconnect.de (EHLO DellWS) [84.179.60.76] by mail.gmx.net (mp058) with SMTP; 26 May 2007 15:10:37 +0200 X-Authenticated: #21318204 Date: Sat, 26 May 2007 14:21:00 -0000 From: Michael Bieber Reply-To: gmx Message-ID: <1522450048.20070526151035@gmx.net> To: pthreads-win32@sourceware.org Subject: Accessing Windows thread id MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2007/txt/msg00026.txt.bz2 @list I would like exploit the technique, described here: http://msdn2.microsoft.com/en-us/library/xcb2z8hs(vs.80).aspx in order to help my Visual Studio debugger with some more expressive thread names. Unfortunately, this is relying on a thread id not being public accessible for pthreads_win32 clients (It is the last argument to _beginthreadex, after that call hidden inside the non-public ptw32_thread_t structure). Windows GetThreadId is no help here, because it isn't defined for Win XP. Even GetCurrentId is not entirely what I would like, because the call to SetThreadName (cf. URL above) doesn't come from the calling thread in my case. So, is there a way to get the Windows thread id in a way similar to pthread_getw32threadhandle_np for a handle? Micha --