fix all but about 8 out of 91 tests. Correct resource usage in xml, fix win32gui...
[reactos.git] / rosapps / tests / threadwait / threadwait.c
1 /*
2 * Author: Skywing (skywing@valhallalegends.com)
3 * Date: 09/09/2003
4 * Purpose: Probe for PsUnblockThread crash due to double-acquire spin lock.
5 */
6
7 #include <windows.h>
8 #include <stdio.h>
9
10 #define NTOS_MODE_USER
11 #include <ndk/ntndk.h>
12
13 DWORD __stdcall threadfunc(void* UNREFERENCED)
14 {
15 printf("Thread: Initialized\n");
16 Sleep(2500);
17 printf("Thread: Terminating...\n");
18 return 0;
19 }
20
21 int main(int ac, char **av)
22 {
23 DWORD id;
24 HANDLE Thread;
25
26 Thread = CreateThread(0, 0, threadfunc, 0, 0, &id);
27 printf("Main: ThreadId for new thread is %08lx\n", id);
28 printf("Main: Waiting on thread...\n");
29 WaitForSingleObject(Thread, INFINITE);
30 printf("Main: OK, somebody fixed the PsUnblockThread spinlock double-acquire crash\n");
31 NtClose(Thread);
32 printf("Main: Terminating...\n");
33 return 0;
34 }