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.
---
mingw-w64-crt/testcases/t_safe_flush.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mingw-w64-crt/testcases/t_safe_flush.c
b/mingw-w64-crt/testcases/t_safe_flush.c
index f58733810cf8..5e617fac9f16 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 @@ static void spawn_thread(void) {
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));
}
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public