crt: test: Replace usage of _beginthreadex() by CreateThread() in t_safe_flush.c test t_safe_flush.c is spawning new thread via _beginthreadex() which only uses WinAPI functions. So it does not need to use CRT function _beginthreadex() for spawning thread and WinAPI CreateThread() is enough. crtdll.dll does not contain _beginthreadex(), so this change allows to compile t_safe_flush.c test against crtdll.dll. Signed-off-by: LIU Hao <lh_mouse@126.com>
diff --git a/mingw-w64-crt/testcases/t_safe_flush.c b/mingw-w64-crt/testcases/t_safe_flush.c index f587338..5e617fa 100644 --- a/mingw-w64-crt/testcases/t_safe_flush.c +++ b/mingw-w64-crt/testcases/t_safe_flush.c
@@ -14,7 +14,7 @@ CRITICAL_SECTION cs; -static unsigned int __stdcall thread_main(void *user_data) { +static DWORD WINAPI thread_main(LPVOID user_data) { HANDLE handle_event = (HANDLE) user_data; /* This thread acquires a critical section and then @@ -34,7 +34,7 @@ HANDLE handle_event; assert(handle_event = CreateEvent(NULL, TRUE, FALSE, NULL)); - assert(_beginthreadex(NULL, 0, thread_main, handle_event, 0, NULL) != 0); + assert(CreateThread(NULL, 0, thread_main, handle_event, 0, NULL) != NULL); assert(WaitForSingleObject(handle_event, INFINITE) == WAIT_OBJECT_0); assert(CloseHandle(handle_event)); }