On 02.07.2019 15:14, 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 [1] 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. >
Good point. In NT world, as long as a handle for a resource exists, the resource itself also exists, even if it's in a state that makes it unusable. Until a handle is explicitly closed, it remains valid. Until all handles to a resource are closed, the resource exists.
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public