c 언어/중급과정
C언어 기초 - 쓰레드 이해하고 사용하는 방법(windows 10)
여린완자
2021. 11. 16. 15:21
/*C언어 기초 - 쓰레드 이해하고 사용하는 방법(windows 10)*/
/*C언어 기초 - 쓰레드 이해하고 사용하는 방법(windows 10)*/
/*C언어 기초 - 쓰레드 이해하고 사용하는 방법(windows 10)*/
#include <stdio.h>
#include <Windows.h>
#include <process.h>
unsigned _stdcall time_tick(void* arg)
{
while(1)
{
Sleep(1000);
draw();
rc=common_check(D_DOWN);
if(rc==FAIL)
{
if(ypos==0)
{
return(FAIL);
}
else
{
while(1)
{
if(check_horizon()==FAIL) break;
}
xpos=MAPX/2;
ypos=0;
//,,
//,,
}
}
}
return(SUCC);
}
void init()
{
_beginthreadex(NULL, 0, time_tick, 0, 0, NULL);
}
void stop()
{}
void main(void)
{
init();
while (1)
{
//,,
//,,
}
stop();
}
>c_tris90_4_4.c
>gcc -c c_tris90_4_4.c
>gcc -o c_tris90_4_4 c_tris90_4_4.o -lm -lws2_32 -lgdi32