reactos/rosapps/tests/threadwait/threadwait.c
Thomas Bluemel 096266737b disable defining ntstatus codes in windows.h/winnt.h when using ndk
svn path=/trunk/; revision=19382
2005-11-20 18:54:55 +00:00

36 lines
818 B
C

/*
* Author: Skywing (skywing@valhallalegends.com)
* Date: 09/09/2003
* Purpose: Probe for PsUnblockThread crash due to double-acquire spin lock.
*/
#define WIN32_NO_STATUS
#include <windows.h>
#include <stdio.h>
#define NTOS_MODE_USER
#include <ndk/ntndk.h>
DWORD __stdcall threadfunc(void* UNREFERENCED)
{
printf("Thread: Initialized\n");
Sleep(2500);
printf("Thread: Terminating...\n");
return 0;
}
int main(int ac, char **av)
{
DWORD id;
HANDLE Thread;
Thread = CreateThread(0, 0, threadfunc, 0, 0, &id);
printf("Main: ThreadId for new thread is %08lx\n", id);
printf("Main: Waiting on thread...\n");
WaitForSingleObject(Thread, INFINITE);
printf("Main: OK, somebody fixed the PsUnblockThread spinlock double-acquire crash\n");
NtClose(Thread);
printf("Main: Terminating...\n");
return 0;
}