4 #define NR_THREADS (30)
8 thread_main1(LPVOID param)
10 printf("Thread 1 running (Counter %lu)\n", (DWORD)param);
11 SleepEx(INFINITE, TRUE);
17 thread_main2(LPVOID param)
19 printf("Thread 2 running (Counter %lu)\n", (DWORD)param);
32 printf("Creating %d threads...\n",NR_THREADS*2);
33 for (i=0;i<NR_THREADS;i++)
50 printf("All threads created...\n");
53 * Waiting for threads is not implemented yet.
54 * If you want to see all threads running, uncomment the
55 * call to SuspendThread(). The test application will
56 * freeze after all threads are created.
58 /* SuspendThread (GetCurrentThread()); */
62 printf("Creating thread...\n");
64 hThread = CreateThread(NULL,
71 printf("Thread created. Waiting for termination...\n");
73 WaitForSingleObject (hThread,
76 CloseHandle (hThread);
78 printf("Thread terminated...\n");