12 #define NR_THREADS (10)
16 DWORD WINAPI
thread_main1(LPVOID param
)
20 printf("Thread %x running\n", param
);
21 s
= nr
= ((nr
* 1103515245) + 12345) & 0x7fffffff;
25 printf("Thread %x finished\n", param
);
29 // Shows the help on how to use these program to the user
33 printf("\nReactOS threads test program (built on %s).\n\n", __DATE__
);
34 printf("syntax:\tthread.exe <seed>\n");
35 printf("\twhere <seed> is an integer number\n");
36 printf("\texample: thread.exe 100\n");
41 int main (int argc
, char* argv
[])
46 HANDLE ThreadHandle
[NR_THREADS
];
48 // The user must supply one argument (the seed). if he/she doesn't
49 // then we show the help.
55 // nr = atoi(argv[1]);
57 printf("Seed %ld\n", nr
);
59 printf("Creating %d threads...\n",NR_THREADS
*2);
60 for (i
=0;i
<NR_THREADS
;i
++)
62 ThreadHandle
[i
] = CreateThread(NULL
,
71 for (i
=0;i
<NR_THREADS
;i
++)
73 ResumeThread(ThreadHandle
[i
]);
76 for (i
=0;i
<NR_THREADS
;i
++)
78 SuspendThread(ThreadHandle
[i
]);
81 for (i
=0;i
<NR_THREADS
;i
++)
83 ResumeThread(ThreadHandle
[i
]);
86 printf("All threads created...\n");