#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로 쓰는건 걍 내 취향