4 #define NR_THREADS (30)
8 thread_main1(LPVOID param
)
10 printf("Thread 1 running (Counter %lu)\n", param
);
11 SleepEx(INFINITE
, TRUE
);
17 thread_main2(LPVOID param
)
19 printf("Thread 2 running (Counter %lu)\n", param
);
31 printf("Creating %d threads...\n",NR_THREADS
*2);
32 for (i
=0;i
<NR_THREADS
;i
++)
49 printf("All threads created...\n");
52 * Waiting for threads is not implemented yet.
53 * If you want to see all threads running, uncomment the
54 * call to SuspendThread(). The test application will
55 * freeze after all threads are created.
57 /* SuspendThread (GetCurrentThread()); */
61 printf("Creating thread...\n");
63 hThread
= CreateThread(NULL
,
70 printf("Thread created. Waiting for termination...\n");
72 WaitForSingleObject (hThread
,
75 CloseHandle (hThread
);
77 printf("Thread terminated...\n");