]> git.ipfire.org Git - thirdparty/git.git/commit
win32: use _endthreadex to terminate threads, not ExitThread
authorSeija Kijin <doremylover123@gmail.com>
Sun, 25 Dec 2022 01:41:50 +0000 (01:41 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 25 Dec 2022 07:34:03 +0000 (16:34 +0900)
commit0006e2e3f1de6a3a5351da298ee52b5d936addfd
treeda07bf621f6455a0cb825cde3ff7246fbedd39a7
parent7c2ef319c52c4997256f5807564523dfd4acdfc7
win32: use _endthreadex to terminate threads, not ExitThread

Because we use the C runtime and
use _beginthreadex to create pthreads,
pthread_exit MUST use _endthreadex.

Otherwise, according to Microsoft:
"Failure to do so results in small
memory leaks when the thread
calls ExitThread."

Simply put, this is not the same as ExitThread.

Signed-off-by: Seija Kijin <doremylover123@gmail.com>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/win32/pthread.h