3 #include <winpr/file.h>
4 #include <winpr/synch.h>
5 #include <winpr/thread.h>
7 static DWORD WINAPI thread_func(LPVOID arg)
16 int TestThreadExitThread(
int argc,
char* argv[])
26 for (
int i = 0; i < 100; i++)
28 thread = CreateThread(NULL, 0, thread_func, NULL, 0, NULL);
30 if (thread == INVALID_HANDLE_VALUE)
32 (void)fprintf(stderr,
"Got an invalid thread!\n");
36 waitResult = WaitForSingleObject(thread, 300);
37 if (waitResult != WAIT_OBJECT_0)
46 stderr,
"300ms should have been enough for the thread to be in a signaled state\n");
50 (void)CloseHandle(thread);