thread를 수행할 때 때로는 다른 thread의 작업을 기다려야 할 때가 있다. 이때 condition_varialbe을 사용하면 thread를 block 할 수 있다. block 조건은 timeout을 설정할 수 도 다른 thread를 통해 설정할 수도 있다. condition_variable은 다음과 같은 method를 제공한다. notify_one : 해당 조건 변수를 기다리고 있는 thread 중 한 개의 thread를 깨운다. notify_all : 해당 조건 변수를 기다리고 있는 모든 thread를 깨운다. thread는 상기 method 이외에 timeout에 의해서 깨어날 수도 있다. #include #include #include using namespace std; mutex g_m..