This is the mail archive of the
mailing list for the GCC project.
Re: [Mingw-w64-public] Fwd: [patch] Reimplement GNU threads library on native Windows
On 02/07/19 20:14 +0800, Liu Hao wrote:
在 2019/7/2 下午8:00, Jonathan Wakely 写道:
The C++ standard says:
"The library may reuse the value of a thread::id of a terminated
thread that can no longer be joined."
So that's not a reason to use a handle.
According to MSDN  a thread ID is valid 'until the thread has been
terminated' so I presume a terminated but unclosed thread does not have
a thread ID.
What do you mean by "unclosed thread"? If I read it correctly, the MSDN page
refers to closing a handle (which makes sense), not closing a thread.
This could also mean that there is no effect way to denote a thread
uniquely. As a consequence libstdc++ may have to its own bookkeeping
As I said in my last mail, libstdc++ does not need a way to denote a
I'm not objecting to Eric's use of a HANDLE for a thread::id, as
his justification makes sense. I'm just saying we don't need a unique
ID that outlives the thread, because that's not a requirement.