Skip to content
Snippets Groups Projects
Commit 08dd7aee authored by 이소현's avatar 이소현
Browse files

th3:문제해결

parent f28cbd89
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
int bbb = 0;
void fn_s()
{
static int a = 0;
printf("== %d %d ==\n",a++, bbb++);
}
void *run (void *arg)
{
printf("Hello world of POSXI threads.%d\n", (int) (0) );
for (int i = 0; i < 100; i++)
{
sleep(1);
fn_s();
}
return 0;
}
int main()
{
int result1;
run((void *) 0);
sleep(10);
run((void *) 0);
printf("Thread return %d at the end\n", result1);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment