This is the mail archive of the
pthreads-win32@sourceware.org
mailing list for the pthreas-win32 project.
Accessing Windows thread id
- From: Michael Bieber <onsager at gmx dot net>
- To: pthreads-win32 at sourceware dot org
- Date: Sat, 26 May 2007 15:10:35 +0200
- Subject: Accessing Windows thread id
- Reply-to: gmx <onsager at gmx dot net>
@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
--