On Tue, May 04, 2021 at 02:39:17PM +0200, Piotr Caban wrote:
Hi Arek,
On 5/4/21 1:49 PM, Arkadiusz Hiler wrote:
/********************************************************************* @@ -88,7 +90,17 @@ void CDECL _endthreadex( { TRACE("(%d)\n", retval);
- /* FIXME */
+#if _MSVCR_VER >= 140
- {
thread_data_t *tls = TlsGetValue(msvcrt_tls_index);
if (tls && tls->module != NULL)
FreeLibraryAndExitThread(tls->module, retval);
else
WARN("tls=%p tls->module=%p\n", tls, tls ? tls->module : NULL);
- }
+#endif
- ExitThread(retval); }
I didn't test it but I bet that _endthreadex should still close the handle if thread was created by _beginthread. It will also make the _endthread and _endthreadex functions identical. Did you check it?
I belive this is covered by msvcrt/tests/misc.c:test_thread_handle_close():
https://source.winehq.org/git/wine.git/blob/3ba4412be60dafee310b5d3c71aa762a...