#include <iostream>
#include <atomic>
#include <thread>
using namespace std;
atomic<bool> 얘가_false가_되면_종료 = true;
void worker()
{
while (얘가_false가_되면_종료)
{
printf("숫자숫자");
}
}
int main()
{
thread thread(worker);
const char 디폴트_글자 = 'i';
char c;
cin >> c;
if (c == 디폴트_글자)
얘가_false가_되면_종료 = false;
thread.join();
return 0;
}
atomic variable를 event object로 쓰는건 걍 내 취향
i가 입력되면 종료하는게 아니라
i를 계속 출력해야 하네..그건 알아서 바꾸셈
얔한동영상봌는곳 >>
http://zzam.me