/*++ Copyright (c) 1990 Microsoft Corporation Module Name: taststrs.c Abstract: Tasking stress test. Author: Mark Lucovsky (markl) 26-Sep-1990 Revision History: --*/ #include #include #include #include HANDLE Semaphore, Event; VOID TestThread( LPVOID ThreadParameter ) { DWORD st; (ReleaseSemaphore(Semaphore,1,NULL)); st = WaitForSingleObject(Event,500); ExitThread(0); } VOID NewProcess() { DWORD st; DWORD ThreadId; HANDLE Thread; DWORD NumberOfThreads; DWORD MaximumThreadCount; DWORD i; // // Create an Event that is never signaled // Event = CreateEvent(NULL,TRUE,FALSE,NULL); // // Create a semaphore signaled by each thread as it starts // Semaphore = CreateSemaphore(NULL,0,256,NULL); (Event); (Semaphore); MaximumThreadCount = 15; NumberOfThreads = 0; // // Create the threads // printf("Creating %d threads... ",MaximumThreadCount); for ( i = 0;i