🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5295

How to name thread created with Win32 CreateThread?

#5295
From: Randall Parker
Date: Thu, 15 Sep 2005 06:34
14 lines
1615 bytes
Using TThread the wizard creates some bizarre RaiseException call that will give a 
thread a name. I created a thread that way and conveniently that thread gets that 
thread name in the debugger. Very handy for knowing which thread is which.

Well, suppose you use Win32 CreateThread? How do name such a thread? I have some code 
that I must keep compatible with MSVC and BCB and need a way to name threads that is 
not VCL specific.

I've looked here:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/process_and_thread_functions.asp

and nothing looks appropriate. The CreateThread API doesn't appear to accept a name 
argument.
Technical Details
Message-ID: <43291590$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,a97544f166359288,start
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 14 Sep 2005 23:34:07 -0700
From: Randall Parker <STOPtechiepundit@EVILfuturePOXpunditSPAM.com>
User-Agent: Mozilla Thunderbird 1.0.5 (Windows/20050711)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: How to name thread created with Win32 CreateThread?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 71.102.162.26
Message-ID: <43291590$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1126765968 71.102.162.26 (14 Sep 2005 23:32:48 -0700)
Lines: 14
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail